add AlertDialog in ToggleAccessNotification
This commit is contained in:
parent
6188330b04
commit
6a2bda3b38
|
@ -219,7 +219,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(const SizedBox(width: 2)),
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -246,84 +246,90 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
FFButtonWidget(
|
Row(
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
enText: 'Cancel',
|
mainAxisSize: MainAxisSize.max,
|
||||||
ptText: 'Cancelar',
|
children: [
|
||||||
),
|
FFButtonWidget(
|
||||||
onPressed: () {
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
Navigator.pop(context);
|
enText: 'Cancel',
|
||||||
},
|
ptText: 'Cancelar',
|
||||||
options: FFButtonOptions(
|
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
|
||||||
height: MediaQuery.of(context).size.height * 0.05,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
),
|
),
|
||||||
borderSide: BorderSide(
|
onPressed: () {
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10)),
|
|
||||||
),
|
|
||||||
FFButtonWidget(
|
|
||||||
onPressed: () async {
|
|
||||||
PhpGroup.resopndeVinculo
|
|
||||||
.call(
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
tarefa: 'I',
|
|
||||||
)
|
|
||||||
// ignore: body_might_complete_normally_catch_error
|
|
||||||
.catchError((err, stack) {
|
|
||||||
log(err.toString());
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Error unlinking device',
|
|
||||||
ptText: 'Erro ao desvincular dispositivo',
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context).info)),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).error,
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).then(
|
|
||||||
(value) {
|
|
||||||
FFAppState().deleteCliUUID();
|
|
||||||
FFAppState().deleteLocal();
|
|
||||||
FFAppState().deleteOwnerUUID();
|
|
||||||
Navigator.pop(context);
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
);
|
options: FFButtonOptions(
|
||||||
notifyListeners();
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
},
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
enText: 'Unlink',
|
textStyle: TextStyle(
|
||||||
ptText: 'Desvincular',
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
borderSide: BorderSide(
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
height: MediaQuery.of(context).size.height * 0.05,
|
width: 1,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
),
|
||||||
textStyle: TextStyle(
|
borderRadius: BorderRadius.circular(10)),
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
),
|
),
|
||||||
borderSide: BorderSide(
|
FFButtonWidget(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
onPressed: () async {
|
||||||
width: 1,
|
PhpGroup.resopndeVinculo
|
||||||
|
.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
tarefa: 'I',
|
||||||
|
)
|
||||||
|
// ignore: body_might_complete_normally_catch_error
|
||||||
|
.catchError((err, stack) {
|
||||||
|
log(err.toString());
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error unlinking device',
|
||||||
|
ptText: 'Erro ao desvincular dispositivo',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).then(
|
||||||
|
(value) {
|
||||||
|
FFAppState().deleteCliUUID();
|
||||||
|
FFAppState().deleteLocal();
|
||||||
|
FFAppState().deleteOwnerUUID();
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
notifyListeners();
|
||||||
|
},
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Unlink',
|
||||||
|
ptText: 'Desvincular',
|
||||||
|
),
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
],
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -350,128 +356,96 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
FFButtonWidget(
|
Row(
|
||||||
onPressed: () => Navigator.pop(context),
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
options: FFButtonOptions(
|
mainAxisSize: MainAxisSize.max,
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
children: [
|
||||||
height: MediaQuery.of(context).size.height * 0.05,
|
FFButtonWidget(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
onPressed: () => Navigator.pop(context),
|
||||||
textStyle: TextStyle(
|
options: FFButtonOptions(
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
),
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
borderSide: BorderSide(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
textStyle: TextStyle(
|
||||||
width: 1,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Cancel',
|
|
||||||
ptText: 'Cancelar',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FFButtonWidget(
|
|
||||||
onPressed: () {
|
|
||||||
PhpGroup.deleteAccount
|
|
||||||
.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
FFAppState().deleteAll();
|
|
||||||
FFAppState().isLogged = false;
|
|
||||||
context.goNamed(
|
|
||||||
'welcomePage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: true,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).catchError((err) {
|
|
||||||
log(err.toString());
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Error deleting account',
|
|
||||||
ptText: 'Erro ao deletar conta',
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context).info)),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).error,
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
borderSide: BorderSide(
|
||||||
});
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
notifyListeners();
|
width: 1,
|
||||||
},
|
),
|
||||||
options: FFButtonOptions(
|
borderRadius: BorderRadius.circular(10),
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
),
|
||||||
height: MediaQuery.of(context).size.height * 0.05,
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
enText: 'Cancel',
|
||||||
textStyle: TextStyle(
|
ptText: 'Cancelar',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
),
|
||||||
),
|
),
|
||||||
borderSide: BorderSide(
|
FFButtonWidget(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
onPressed: () {
|
||||||
width: 1,
|
PhpGroup.deleteAccount
|
||||||
|
.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
FFAppState().deleteAll();
|
||||||
|
FFAppState().isLogged = false;
|
||||||
|
context.goNamed(
|
||||||
|
'welcomePage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}).catchError((err) {
|
||||||
|
log(err.toString());
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error deleting account',
|
||||||
|
ptText: 'Erro ao deletar conta',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
notifyListeners();
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Delete',
|
||||||
|
ptText: 'Deletar',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
],
|
||||||
),
|
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Delete',
|
|
||||||
ptText: 'Deletar',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
// PhpGroup.deleteAccount
|
|
||||||
// .call(
|
|
||||||
// devUUID: FFAppState().devUUID,
|
|
||||||
// userUUID: FFAppState().userUUID,
|
|
||||||
// )
|
|
||||||
// .then((value) {
|
|
||||||
// FFAppState().deleteAll();
|
|
||||||
// FFAppState().isLogged = false;
|
|
||||||
// context.goNamed(
|
|
||||||
// 'welcomePage',
|
|
||||||
// extra: <String, dynamic>{
|
|
||||||
// kTransitionInfoKey: const TransitionInfo(
|
|
||||||
// hasTransition: true,
|
|
||||||
// transitionType: PageTransitionType.scale,
|
|
||||||
// alignment: Alignment.bottomCenter,
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }).catchError((err) {
|
|
||||||
// log(err.toString());
|
|
||||||
// ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text(
|
|
||||||
// FFLocalizations.of(context).getVariableText(
|
|
||||||
// ptText: 'Erro ao deletar dispositivo',
|
|
||||||
// enText: 'Error deleting device',
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
|
||||||
// backgroundColor: FlutterFlowTheme.of(context).error,
|
|
||||||
// duration: const Duration(seconds: 3),
|
|
||||||
// behavior: SnackBarBehavior.floating,
|
|
||||||
// shape: RoundedRectangleBorder(
|
|
||||||
// borderRadius: BorderRadius.circular(30),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> togglePass(BuildContext context) async {
|
Future<void> togglePass(BuildContext context) async {
|
||||||
|
|
Loading…
Reference in New Issue