Skip to content

Commit

Permalink
ui: add donate button
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Oct 27, 2024
1 parent 5e9e852 commit 0305c07
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Binary file added ui/assets/wechat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 32 additions & 5 deletions ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class _MyAppState extends ConsumerState<MyApp> {
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),
),
);
Expand Down Expand Up @@ -222,9 +223,9 @@ class _MainSkeletonState extends State<MainSkeleton> {
(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(
Expand All @@ -247,7 +248,13 @@ class _MainSkeletonState extends State<MainSkeleton> {
child: const Icon(Icons.account_circle),
);
},
)
),
IconButton(
onPressed: () => showDonate(context),
icon: Icon(
Icons.heart_broken_rounded,
color: Colors.red,
)),
],
),
useDrawer: false,
Expand Down Expand Up @@ -302,4 +309,24 @@ class _MainSkeletonState extends State<MainSkeleton> {
// 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"))

),
);
},
);
}
}
3 changes: 2 additions & 1 deletion ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0305c07

Please sign in to comment.