@@ -24,6 +24,7 @@ import 'package:flood_mobile/Provider/sse_provider.dart';
24
24
import 'package:flood_mobile/Provider/user_detail_provider.dart' ;
25
25
import 'package:flood_mobile/Route/routes.dart' ;
26
26
import 'package:flutter/material.dart' hide Badge;
27
+ import 'package:flutter/scheduler.dart' ;
27
28
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart' ;
28
29
import 'package:flutter_svg/svg.dart' ;
29
30
import 'package:fluttertoast/fluttertoast.dart' ;
@@ -178,10 +179,10 @@ class _HomeScreenState extends State<HomeScreen> {
178
179
screenCurrent = AboutScreen (index: themeIndex);
179
180
break ;
180
181
}
181
- if (needsSetup) {
182
- if (themeIndex == 1 ) {
182
+ if (needsSetup && themeIndex == 1 ) {
183
+ SchedulerBinding .instance. addPostFrameCallback ((_ ) {
183
184
controller.open ();
184
- }
185
+ });
185
186
}
186
187
return Consumer <HomeProvider >(
187
188
builder: (context, homeModel, child) {
@@ -191,10 +192,12 @@ class _HomeScreenState extends State<HomeScreen> {
191
192
onWillPop: onBackPressed,
192
193
child: Scaffold (
193
194
appBar: AppBar (
195
+ key: Key ('AppBar $themeIndex ' ),
194
196
leading: ! selectTorrent.isSelectionMode
195
197
? IconButton (
196
198
icon: Icon (
197
199
Icons .menu,
200
+ key: Key ('Menu Icon $themeIndex ' ),
198
201
color: ThemeProvider .theme (themeIndex)
199
202
.textTheme
200
203
.bodyLarge
@@ -214,7 +217,7 @@ class _HomeScreenState extends State<HomeScreen> {
214
217
},
215
218
icon: Icon (Icons .close)),
216
219
title: Image (
217
- key: Key ('Flood Icon' ),
220
+ key: Key ('Flood Icon $ themeIndex ' ),
218
221
image: AssetImage (
219
222
'assets/images/icon.png' ,
220
223
),
@@ -233,7 +236,7 @@ class _HomeScreenState extends State<HomeScreen> {
233
236
showBadge: homeModel.unreadNotifications == 0
234
237
? false
235
238
: true ,
236
- key: Key ('Badge Widget' ),
239
+ key: Key ('Badge Widget $ themeIndex ' ),
237
240
badgeColor: ThemeProvider .theme (themeIndex)
238
241
.colorScheme
239
242
.secondary,
@@ -245,6 +248,7 @@ class _HomeScreenState extends State<HomeScreen> {
245
248
),
246
249
position: BadgePosition (top: 0 , end: 3 ),
247
250
child: IconButton (
251
+ key: Key ('Notification Button $themeIndex ' ),
248
252
icon: Icon (
249
253
Icons .notifications,
250
254
),
@@ -253,7 +257,8 @@ class _HomeScreenState extends State<HomeScreen> {
253
257
context: context,
254
258
builder: (BuildContext context) {
255
259
return AlertDialog (
256
- key: Key ('Notification Alert Dialog' ),
260
+ key: Key (
261
+ 'Notification Alert Dialog $themeIndex ' ),
257
262
elevation: 0 ,
258
263
backgroundColor:
259
264
ThemeProvider .theme (themeIndex)
@@ -457,7 +462,7 @@ class _MenuState extends State<Menu> {
457
462
mainAxisAlignment: MainAxisAlignment .start,
458
463
children: [
459
464
Image (
460
- key: Key ('Flood Icon menu' ),
465
+ key: Key ('Flood Icon menu ${ widget . index } ' ),
461
466
width: 80 ,
462
467
height: 80 ,
463
468
image: AssetImage (
@@ -479,7 +484,7 @@ class _MenuState extends State<Menu> {
479
484
children: [
480
485
SvgPicture .network (
481
486
'https://img.shields.io/github/v/release/CCExtractor/Flood_Mobile?include_prereleases' ,
482
- key: Key ('Release Shield' ),
487
+ key: Key ('Release Shield ${ widget . index } ' ),
483
488
),
484
489
],
485
490
),
0 commit comments