This commit is contained in:
jantunesmesias 2024-08-08 08:50:20 -03:00
parent 5e99d8cb02
commit 1da4899d5a
1 changed files with 21 additions and 1 deletions

View File

@ -157,8 +157,8 @@ class PreferencesPageModel with ChangeNotifier {
notifica: FFAppState().notify ? 'S' : 'N', notifica: FFAppState().notify ? 'S' : 'N',
) )
.then((value) { .then((value) {
Navigator.pop(context);
if (value.jsonBody['error'] == false) { if (value.jsonBody['error'] == false) {
Navigator.pop(context);
FFAppState().notify = !FFAppState().notify; FFAppState().notify = !FFAppState().notify;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
@ -182,6 +182,26 @@ class PreferencesPageModel with ChangeNotifier {
), ),
), ),
); );
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
FFLocalizations.of(context).getVariableText(
ptText: 'Erro ao alterar notificação',
enText: 'Error changing notification',
),
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),
),
),
);
} }
}).catchError((err) { }).catchError((err) {
Navigator.pop(context); Navigator.pop(context);