WIP
This commit is contained in:
parent
5e99d8cb02
commit
1da4899d5a
|
@ -157,8 +157,8 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
notifica: FFAppState().notify ? 'S' : 'N',
|
notifica: FFAppState().notify ? 'S' : 'N',
|
||||||
)
|
)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value.jsonBody['error'] == false) {
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
if (value.jsonBody['error'] == false) {
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue