This commit is contained in:
J. A. Messias 2024-11-12 13:59:25 -03:00
parent fd5e68469b
commit 6055ba0cc9
2 changed files with 4 additions and 7 deletions

View File

@ -18,8 +18,8 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
} }
Future<void> getData() async { Future<void> getData() async {
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; cliName = await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage) ?? '';
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
setStateCallback?.call(); setStateCallback?.call();
} }

View File

@ -56,9 +56,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
void onUpdate() { void onUpdate() {
log('() => onUpdate()'); log('() => onUpdate()');
safeSetState(() { safeSetState(() async => await _model.getData());
_model.getData();
});
} }
@override @override
@ -98,8 +96,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
onTap: () async { onTap: () async {
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage); await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
await LocalizationService.processLocals(context) await LocalizationService.processLocals(context).whenComplete(() => onUpdate());
.then((value) => value == true ? onUpdate() : null);
}, },
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(200.0), borderRadius: BorderRadius.circular(200.0),