Skip to content

Commit

Permalink
Fix FCM message
Browse files Browse the repository at this point in the history
  • Loading branch information
dewmal committed Mar 22, 2020
1 parent efa0c79 commit ae76062
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/page/screen/root_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _RootScreenState extends State<RootScreen> {
final _homeTabs = {
DashboardScreen(),
CaseListScreen(),
CaseDetailScreen(),
// CaseDetailScreen(),
ContactUsScreen(),
};

Expand Down Expand Up @@ -82,13 +82,23 @@ class _RootScreenState extends State<RootScreen> {
_messaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage");
await setState(() {
_currentIndex = 0;
});
_handleFCM(message);
},
onResume: (Map<String, dynamic> message) async {
print("onResume");
await setState(() {
_currentIndex = 0;
});
_handleFCM(message);
},
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch");
await setState(() {
_currentIndex = 0;
});
_handleFCM(message);
},
);
Expand All @@ -107,10 +117,10 @@ class _RootScreenState extends State<RootScreen> {
title: AppLocalizations.of(context)
.translate('dashboard_case_list_tab_text'),
icon: Icons.location_searching),
TitledNavigationBarItem(
title: AppLocalizations.of(context)
.translate('dashboard_safe_track_tab_text'),
icon: Icons.map),
// TitledNavigationBarItem(
// title: AppLocalizations.of(context)
// .translate('dashboard_safe_track_tab_text'),
// icon: Icons.map),
TitledNavigationBarItem(
title: AppLocalizations.of(context)
.translate('dashboard_contact_tab_text'),
Expand Down

0 comments on commit ae76062

Please sign in to comment.