This commit is contained in:
jantunesmesias 2024-08-08 08:45:19 -03:00
parent fc77d67767
commit 929c18ba9e
1 changed files with 54 additions and 47 deletions

View File

@ -147,6 +147,7 @@ class PreferencesPageModel with ChangeNotifier {
), ),
FFButtonWidget( FFButtonWidget(
onPressed: () async { onPressed: () async {
try {
PhpGroup.changeNotifica PhpGroup.changeNotifica
.call( .call(
userUUID: FFAppState().userUUID, userUUID: FFAppState().userUUID,
@ -166,7 +167,8 @@ class PreferencesPageModel with ChangeNotifier {
enText: 'Notification changed successfully', enText: 'Notification changed successfully',
), ),
style: TextStyle( style: TextStyle(
color: FlutterFlowTheme.of(context).info)), color:
FlutterFlowTheme.of(context).info)),
backgroundColor: backgroundColor:
FlutterFlowTheme.of(context).success, FlutterFlowTheme.of(context).success,
duration: const Duration(seconds: 3), duration: const Duration(seconds: 3),
@ -186,8 +188,10 @@ class PreferencesPageModel with ChangeNotifier {
ptText: 'Erro ao alterar notificação', ptText: 'Erro ao alterar notificação',
), ),
style: TextStyle( style: TextStyle(
color: FlutterFlowTheme.of(context).info)), color:
backgroundColor: FlutterFlowTheme.of(context).error, FlutterFlowTheme.of(context).info)),
backgroundColor:
FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3), duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -196,7 +200,10 @@ class PreferencesPageModel with ChangeNotifier {
), ),
); );
}).whenComplete(() => notifyListeners()); }).whenComplete(() => notifyListeners());
} on Exception catch (e) {
log(e.toString());
Navigator.pop(context); Navigator.pop(context);
}
}, },
text: FFLocalizations.of(context).getVariableText( text: FFLocalizations.of(context).getVariableText(
enText: 'Yes', enText: 'Yes',