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 {
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
cliName = await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage) ?? '';
cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
setStateCallback?.call();
}

View File

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