diff --git a/ui/assets/wechat.jpg b/ui/assets/wechat.jpg new file mode 100644 index 0000000..fd12179 Binary files /dev/null and b/ui/assets/wechat.jpg differ diff --git a/ui/lib/main.dart b/ui/lib/main.dart index 9dee681..415c3ec 100644 --- a/ui/lib/main.dart +++ b/ui/lib/main.dart @@ -56,7 +56,8 @@ class _MyAppState extends ConsumerState { return SelectionArea( child: MainSkeleton( body: Padding( - padding: EdgeInsets.only(left: padding, right: padding, top: 5, bottom: 5), + padding: EdgeInsets.only( + left: padding, right: padding, top: 5, bottom: 5), child: child), ), ); @@ -222,9 +223,9 @@ class _MainSkeletonState extends State { (BuildContext context, SearchController controller) { return [Text("dadada")]; }), - IconButton( - onPressed: () => showCalendar(context), - icon: Icon(Icons.calendar_month)), + // IconButton( + // onPressed: () => showCalendar(context), + // icon: Icon(Icons.calendar_month)), MenuAnchor( menuChildren: [ MenuItemButton( @@ -247,7 +248,13 @@ class _MainSkeletonState extends State { child: const Icon(Icons.account_circle), ); }, - ) + ), + IconButton( + onPressed: () => showDonate(context), + icon: Icon( + Icons.heart_broken_rounded, + color: Colors.red, + )), ], ), useDrawer: false, @@ -302,4 +309,24 @@ class _MainSkeletonState extends State { // overridden. ); } + + showDonate(BuildContext context) { + return showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return AlertDialog( + title: Text("项目开发不易,给开发者加个鸡腿:"), + content: SizedBox( + width: 350, + height: 400, + child: + Ink.image( + fit: BoxFit.fitWidth, image: AssetImage("assets/wechat.jpg")) + + ), + ); + }, + ); + } } diff --git a/ui/pubspec.yaml b/ui/pubspec.yaml index e19e1b9..c607e88 100644 --- a/ui/pubspec.yaml +++ b/ui/pubspec.yaml @@ -71,7 +71,8 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: + assets: + - assets/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg