Skip to content

Commit 3ea4217

Browse files
committed
Feat: donate dialog
1 parent 7706826 commit 3ea4217

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

assets/images/afdian.png

2.96 KB
Loading

assets/images/dundun.png

39.6 KB
Loading

lib/pages/setting/about_page.dart

+60
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io';
22

3+
import 'package:extended_image/extended_image.dart';
34
import 'package:fehviewer/common/global.dart';
45
import 'package:fehviewer/common/service/ehconfig_service.dart';
56
import 'package:fehviewer/common/service/layout_service.dart';
@@ -101,6 +102,65 @@ class ListViewAbout extends StatelessWidget {
101102
id: isLayoutLarge ? 2 : null,
102103
);
103104
},
105+
),
106+
TextItem(
107+
L10n.of(context).donate,
108+
onTap: () {
109+
showCupertinoDialog(
110+
context: context,
111+
builder: (context) {
112+
return CupertinoAlertDialog(
113+
title: Text(L10n.of(context).donate),
114+
content: Container(
115+
// padding: const EdgeInsets.symmetric(vertical: 12),
116+
child: Row(
117+
mainAxisAlignment: MainAxisAlignment.spaceAround,
118+
children: [
119+
CupertinoButton(
120+
child: Column(
121+
children: [
122+
ExtendedImage.asset(
123+
'assets/images/afdian.png',
124+
width: 50,
125+
),
126+
Text(
127+
'爱发电',
128+
),
129+
],
130+
),
131+
onPressed: () {
132+
launchUrlString('https://afdian.net/@honjow');
133+
}),
134+
CupertinoButton(
135+
child: Column(
136+
children: [
137+
ExtendedImage.asset(
138+
'assets/images/dundun.png',
139+
width: 40,
140+
).paddingSymmetric(vertical: 6),
141+
Text(
142+
'顿顿饭',
143+
),
144+
],
145+
),
146+
onPressed: () {
147+
launchUrlString(
148+
'https://dun.mianbaoduo.com/@honjow');
149+
},
150+
),
151+
],
152+
),
153+
),
154+
actions: [
155+
CupertinoDialogAction(
156+
child: Text(L10n.of(context).cancel),
157+
onPressed: Get.back,
158+
),
159+
],
160+
);
161+
},
162+
);
163+
},
104164
hideLine: true,
105165
),
106166
],

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,4 @@ flutter:
206206
- assets/templates/epub/OEBPS/
207207
- assets/templates/epub/OEBPS/content/
208208
- assets/templates/epub/OEBPS/content/resources/
209+
- assets/images/

0 commit comments

Comments
 (0)