Skip to content

Commit

Permalink
flutter widget
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderTitan committed Dec 13, 2020
1 parent 58d9d78 commit d29340a
Show file tree
Hide file tree
Showing 17 changed files with 1,066 additions and 119 deletions.
3 changes: 3 additions & 0 deletions mahua_pet/lib/caches/shared_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ class SharedStorage {

/// 清除缓存信息
static clearAll(Store store) async {
configInfo = ConfigInfo();
SharedUtils.remove(ShareConstant.configInfo);
store.dispatch(UpdateConfigInfo(ConfigInfo()));

loginInfo = LoginInfo();
SharedUtils.remove(ShareConstant.loginInfo);
store.dispatch(UpdateLoginInfo(LoginInfo()));

userData = UserData();
SharedUtils.remove(ShareConstant.userData);
store.dispatch(UpdateUserInfo(UserData()));
}
Expand Down
72 changes: 36 additions & 36 deletions mahua_pet/lib/component/toast_bot.dart
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:mahua_pet/styles/app_style.dart';

class BTToast {

/// 点按位置弹窗
static void showAttached(BuildContext context, List<String> rows, void Function(String, int) callback) {
final titles = rows ?? [];
BotToast.showAttachedWidget(
duration: null,
targetContext: context,
attachedBuilder: (cancelFunc) => Card(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.px),
height: 40.px * titles.length,
child: Column(
children: titles.map((e) {
final index = titles.indexOf(e);
return GestureDetector(
child: Container(
height: 40.px,
width: 80.px,
alignment: Alignment.center,
child: Text(e, style: TextStyle(fontSize: 15.px, color: TKColor.color_333333)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: TKColor.color_e8e8e8,
width: index == titles.length - 1 ? 0 : 0.5
)
)
),
),
onTap: () {
cancelFunc();
callback(e, index);
},
);
}).toList(),
),
),
),
);

// BotToast.showAttachedWidget(
// duration: null,
// targetContext: context,
// attachedBuilder: (cancelFunc) => Card(
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 8.px),
// height: 40.px * titles.length,
// child: Column(
// children: titles.map((e) {
// final index = titles.indexOf(e);
// return GestureDetector(
// child: Container(
// height: 40.px,
// width: 80.px,
// alignment: Alignment.center,
// child: Text(e, style: TextStyle(fontSize: 15.px, color: TKColor.color_333333)),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: TKColor.color_e8e8e8,
// width: index == titles.length - 1 ? 0 : 0.5
// )
// )
// ),
// ),
// onTap: () {
// cancelFunc();
// callback(e, index);
// },
// );
// }).toList(),
// ),
// ),
// ),
// );
}
}
11 changes: 11 additions & 0 deletions mahua_pet/lib/flutter_widget/widget/list_items.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
import 'section_a/a_animated.dart';
import 'section_a/a_section.dart';
import 'section_a/d_dialog.dart';


Map<String, WidgetBuilder> routeLists = {
'SectionA': (context) => SectionA(),
'Animated': (context) => AnimatWidget(),
'Dialog': (context) => DialogShow(),
};
Loading

0 comments on commit d29340a

Please sign in to comment.