WIP
This commit is contained in:
parent
0aa9648616
commit
ebdcf93deb
|
@ -113,6 +113,30 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> signOut(BuildContext context) async {
|
||||
showAlertDialog(
|
||||
context,
|
||||
'Logout',
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Are you sure you want to logout?',
|
||||
ptText: 'Tem certeza',
|
||||
), () async {
|
||||
AppState().deleteAll();
|
||||
// setState(() {});
|
||||
|
||||
context.goNamed(
|
||||
'welcomePage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future preferencesSettings(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'preferencesSettings',
|
||||
|
|
|
@ -251,6 +251,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
ptText: 'Consultar Historicos',
|
||||
),
|
||||
),
|
||||
MenuCardItem(
|
||||
icon: Icons.logout,
|
||||
action: () async {
|
||||
await _model.signOut(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Logout Account',
|
||||
ptText: 'Sair da Conta',
|
||||
),
|
||||
),
|
||||
MenuCardItem(
|
||||
icon: Icons.settings,
|
||||
action: () async {
|
||||
|
|
|
@ -313,8 +313,18 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
AppState().deleteCliUUID();
|
||||
AppState().deleteLocal();
|
||||
AppState().deleteOwnerUUID();
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context, true);
|
||||
// Navigator.pop(context);
|
||||
// Navigator.pop(context, true);
|
||||
context.goNamed(
|
||||
'homePage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
|
|
Loading…
Reference in New Issue