This commit is contained in:
jantunesmesias 2024-08-08 08:48:47 -03:00
parent 929c18ba9e
commit 5e99d8cb02
1 changed files with 24 additions and 19 deletions

View File

@ -157,27 +157,32 @@ class PreferencesPageModel with ChangeNotifier {
notifica: FFAppState().notify ? 'S' : 'N', notifica: FFAppState().notify ? 'S' : 'N',
) )
.then((value) { .then((value) {
FFAppState().notify = !FFAppState().notify; if (value.jsonBody['error'] == false) {
Navigator.pop(context);
FFAppState().notify = !FFAppState().notify;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Notificação alterada com sucesso', ptText:
enText: 'Notification changed successfully', 'Notificação alterada com sucesso',
), enText:
style: TextStyle( 'Notification changed successfully',
color: ),
FlutterFlowTheme.of(context).info)), style: TextStyle(
backgroundColor: color:
FlutterFlowTheme.of(context).success, FlutterFlowTheme.of(context).info)),
duration: const Duration(seconds: 3), backgroundColor:
behavior: SnackBarBehavior.floating, FlutterFlowTheme.of(context).success,
shape: RoundedRectangleBorder( duration: const Duration(seconds: 3),
borderRadius: BorderRadius.circular(30), behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
), ),
), );
); }
}).catchError((err) { }).catchError((err) {
Navigator.pop(context); Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(