|
|
@ -10,6 +10,7 @@ class GlobalPopups extends StatefulWidget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class _GlobalPopupsState extends State<GlobalPopups> { |
|
|
|
class _GlobalPopupsState extends State<GlobalPopups> { |
|
|
|
|
|
|
|
late GlobalOptions _globalOptions; |
|
|
|
late FirstLaunchBloc _firstLaunchBloc; |
|
|
|
late FirstLaunchBloc _firstLaunchBloc; |
|
|
|
late NextPushBloc _nextPushBloc; |
|
|
|
late NextPushBloc _nextPushBloc; |
|
|
|
|
|
|
|
|
|
|
@ -17,25 +18,31 @@ class _GlobalPopupsState extends State<GlobalPopups> { |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_globalOptions = Provider.of<GlobalOptions>(context, listen: false); |
|
|
|
_firstLaunchBloc = Provider.of<FirstLaunchBloc>(context, listen: false); |
|
|
|
_firstLaunchBloc = Provider.of<FirstLaunchBloc>(context, listen: false); |
|
|
|
_nextPushBloc = Provider.of<NextPushBloc>(context, listen: false); |
|
|
|
_nextPushBloc = Provider.of<NextPushBloc>(context, listen: false); |
|
|
|
|
|
|
|
|
|
|
|
_firstLaunchBloc.onFirstLaunch.listen((final _) { |
|
|
|
_firstLaunchBloc.onFirstLaunch.listen((final _) async { |
|
|
|
ScaffoldMessenger.of(context).showSnackBar( |
|
|
|
if (await _globalOptions.pushNotificationsEnabled.enabled.first) { |
|
|
|
SnackBar( |
|
|
|
if (!mounted) { |
|
|
|
content: Text(AppLocalizations.of(context).firstLaunchGoToSettingsToEnablePushNotifications), |
|
|
|
return; |
|
|
|
action: SnackBarAction( |
|
|
|
} |
|
|
|
label: AppLocalizations.of(context).settings, |
|
|
|
ScaffoldMessenger.of(context).showSnackBar( |
|
|
|
onPressed: () async { |
|
|
|
SnackBar( |
|
|
|
await Navigator.of(context).push( |
|
|
|
content: Text(AppLocalizations.of(context).firstLaunchGoToSettingsToEnablePushNotifications), |
|
|
|
MaterialPageRoute( |
|
|
|
action: SnackBarAction( |
|
|
|
builder: (final context) => const SettingsPage(), |
|
|
|
label: AppLocalizations.of(context).settings, |
|
|
|
), |
|
|
|
onPressed: () async { |
|
|
|
); |
|
|
|
await Navigator.of(context).push( |
|
|
|
}, |
|
|
|
MaterialPageRoute( |
|
|
|
|
|
|
|
builder: (final context) => const SettingsPage(), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
_nextPushBloc.onNextPushSupported.listen((final _) async { |
|
|
|
_nextPushBloc.onNextPushSupported.listen((final _) async { |
|
|
|