Skip to content

Commit 21c2164

Browse files
committed
move web version warning to dialog
1 parent 3af3a79 commit 21c2164

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

lib/widgets/collection_page.dart

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,25 @@ class CollectionPageState extends State<CollectionPage> {
6060
showBadge: false,
6161
);
6262

63-
if (!kIsWeb && Platform.isAndroid) {
63+
if (kIsWeb) {
64+
showDialog<String>(
65+
context: context,
66+
builder: (BuildContext context) => AlertDialog(
67+
title: const Text('Warning'),
68+
content: const Text(
69+
'All data is saved locally and will be lost if you clear your browsing data.'
70+
),
71+
actions: <Widget>[
72+
TextButton(
73+
onPressed: () async {
74+
Navigator.pop(context, 'OK');
75+
},
76+
child: const Text('OK'),
77+
),
78+
],
79+
),
80+
);
81+
} else if (Platform.isAndroid) {
6482
FlutterBackground.hasPermissions.then((hasPermissions) {
6583
if (!hasPermissions && mounted) {
6684
showDialog<String>(
@@ -307,17 +325,6 @@ class CollectionPageState extends State<CollectionPage> {
307325
},
308326
),
309327
),
310-
kIsWeb
311-
? Container(
312-
color: Colors.yellowAccent,
313-
width: MediaQuery.of(context).size.width,
314-
child: Center(
315-
child: Text(
316-
"All data is saved locally and will be lost if you clear your browsing data.",
317-
),
318-
),
319-
)
320-
: Container(),
321328
],
322329
),
323330
floatingActionButton: Column(

0 commit comments

Comments
 (0)