I have a issue with menuView.
return new DrawerScaffold(
percentage: 1,
cornerRadius: 0,
appBar: AppBarProps(
backgroundColor: getAppBarBgColor("default"),
title: Text(AppTranslations != null ? AppTranslations.of(context).text("home_appbar_text"):"", style: TextStyle(color: getAppBarTxtColor("default")),),
centerTitle: true,
actions: [
//
//IconButton(icon: Icon(Icons.add), onPressed: () {}),
IconButton(icon: Icon(Icons.account_circle), onPressed: () {
goToScreen(context, ProfileScreen());
/* showDialog(
context: context,
builder: (BuildContext context) => RechargeByPINScreen(
title: "Recharge By PIN",
description: "Hello, this is dummy description",
okbuttontxt: "Okay",
cancelbuttontxt: "Cancel",
subsNo: 0,
),
);*/
}),
IconButton(icon: Icon(Icons.language), onPressed: () {goToScreen(context, LanguageSelectorPage());}),
]),
menuView: MenuView(
selectorColor: drawerSelectedColor,
menu: Menu(
items: [
new MenuItem(
id: 'menuHome',
icon: Icons.home,
title: AppTranslations.of(context).text("menu_home"),
),
new MenuItem(
id: 'menuTransations',
icon: Icons.transform,
title: AppTranslations.of(context).text("menu_transaction"),
),
new MenuItem(
id: 'menuInvoice',
icon: Icons.receipt,
title: AppTranslations.of(context).text("menu_invoice"),
),
new MenuItem(
id: 'menuMySession',
icon: Icons.timelapse,
title: AppTranslations.of(context).text("menu_my_session"),
),
/* new MenuItem(
id: 'menuServices',
icon: Icons.traffic,
title: 'Services',
),*/
new MenuItem(
id: 'menuSubscriptions',
icon: Icons.subscriptions,
title: AppTranslations.of(context).text("menu_subscriptions"),
),
new MenuItem(
id: 'menuSessionHistory',
icon: Icons.history,
title: AppTranslations.of(context).text("menu_session_history"),
),
new MenuItem(
id: 'menuUsageSummary',
icon: Icons.settings,
title: AppTranslations.of(context).text("menu_usage_summary"),
),
new MenuItem(
id: 'menuRateUs',
icon: Icons.question_answer,
title: AppTranslations.of(context).text("menu_rate_us"),
),
/* new MenuItem(
id: 'menuShare',
icon: Icons.data_usage,
title: 'Share',
),*/
/* new MenuItem(
id: 'menuFeedback',
icon: Icons.feedback,
title: 'Feedback'
),*/
new MenuItem(
id: 'menuLogout',
icon: Icons.all_out,
title: AppTranslations.of(context).text("menu_logout"),
),
],
),
animation: false,
alignment: Alignment.topCenter,
color: getThemeColor(),
selectedItemId: selectedMenuItemId,
onMenuItemSelected: (String itemId) {
selectedMenuItemId = itemId;
if (itemId == 'menuHome') {
//setState(() => {});
//Navigator.pushReplacementNamed(context, "/login");
}
else if(itemId == 'menuTransations'){
goToScreen(context, Transactions(title: AppTranslations != null ?AppTranslations.of(context).text("transaction_appbar_text"):"",));
}
else if(itemId == 'menuInvoice'){
goToScreen(context, InvoiceList(title: AppTranslations != null ?AppTranslations.of(context).text("invoice_appbar_text"):"",));
}
else if(itemId == 'menuMySession'){
goToScreen(context, MySession(title: AppTranslations != null ?AppTranslations.of(context).text("mysession_appbar_text"):"",));
}
else if(itemId == 'menuSubscriptions'){
goToScreen(context, Subscriptions(title: AppTranslations != null ?AppTranslations.of(context).text("subscriptions_appbar_text"):"",));
}
else if(itemId == 'menuSessionHistory'){
goToScreen(context, SessionHistory(title: AppTranslations != null ?AppTranslations.of(context).text("session_history_appbar_text"):"",));
}
else if(itemId == 'menuUsageSummary'){
goToScreen(context, UsageSummary(title: AppTranslations != null ?AppTranslations.of(context).text("usage_summary_appbar_text"):"",));
}
else if(itemId == 'menuRateUs'){
//LaunchReview.launch(); use for current app open in play store
LaunchReview.launch(androidAppId: "net.inventum.selfcare");
}
else{
//menuLogout -- logout
showDialog(
context: context,
builder: (BuildContext context) {
// return object of type Dialog
return AlertDialog(
title: new Text(AppTranslations != null ?AppTranslations.of(context).text("dialog_alert_text"):""),
content: new Text(AppTranslations != null ?AppTranslations.of(context).text("logout_text"):""),
actions: <Widget>[
// usually buttons at the bottom of the dialog
new FlatButton(
child: new Text(AppTranslations != null ?AppTranslations.of(context).text("no_text"):""),
onPressed: () {
Navigator.of(context).pop();
},
),
new FlatButton(
child: new Text(AppTranslations != null ?AppTranslations.of(context).text("yes_text"):""),
onPressed: () {
Navigator.of(context).pop();
clearSharedData();
},
),
],
);
},
);
}
// this used to always select home tag
//start
setState(() => {
this.selectedMenuItemId = 'menuHome'
});
//end
},
),
contentView: Screen(
contentBuilder: (context) => LayoutBuilder(
builder: (context, constraint) => HomeView(),
),
color: Colors.white,
)
);