ui: add donate button

This commit is contained in:
Simon Ding
2024-10-27 21:19:02 +08:00
parent 5e9e85206e
commit 0305c0709d
3 changed files with 34 additions and 6 deletions

BIN
ui/assets/wechat.jpg Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -56,7 +56,8 @@ class _MyAppState extends ConsumerState<MyApp> {
return SelectionArea( return SelectionArea(
child: MainSkeleton( child: MainSkeleton(
body: Padding( 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), child: child),
), ),
); );
@@ -222,9 +223,9 @@ class _MainSkeletonState extends State<MainSkeleton> {
(BuildContext context, SearchController controller) { (BuildContext context, SearchController controller) {
return [Text("dadada")]; return [Text("dadada")];
}), }),
IconButton( // IconButton(
onPressed: () => showCalendar(context), // onPressed: () => showCalendar(context),
icon: Icon(Icons.calendar_month)), // icon: Icon(Icons.calendar_month)),
MenuAnchor( MenuAnchor(
menuChildren: [ menuChildren: [
MenuItemButton( MenuItemButton(
@@ -247,7 +248,13 @@ class _MainSkeletonState extends State<MainSkeleton> {
child: const Icon(Icons.account_circle), child: const Icon(Icons.account_circle),
); );
}, },
) ),
IconButton(
onPressed: () => showDonate(context),
icon: Icon(
Icons.heart_broken_rounded,
color: Colors.red,
)),
], ],
), ),
useDrawer: false, useDrawer: false,
@@ -302,4 +309,24 @@ class _MainSkeletonState extends State<MainSkeleton> {
// overridden. // overridden.
); );
} }
showDonate(BuildContext context) {
return showDialog<void>(
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"))
),
);
},
);
}
} }

View File

@@ -71,7 +71,8 @@ flutter:
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: assets:
- assets/
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg