fix: seleção de local após login

This commit is contained in:
J. A. Messias 2024-11-11 10:31:31 -03:00
parent 892c26273e
commit 942fd253c7
1 changed files with 10 additions and 4 deletions

View File

@ -3,6 +3,8 @@ import 'dart:developer';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/shared/helpers/base_storage.dart';
import 'package:hub/shared/helpers/storage_helper.dart';
import '/flutter_flow/custom_functions.dart' as functions;
import '/flutter_flow/flutter_flow_theme.dart';
@ -34,10 +36,14 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
_model = createModel(context, () => LocalProfileComponentModel());
_model.setOnUpdate(onUpdate: () => setState(() {}));
_model.setStateCallback = () => safeSetState(() {});
//
// WidgetsBinding.instance
// .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null));
// LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null);
WidgetsBinding.instance.addPostFrameCallback((_) async{
final String? cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage);
if(cliUUID == null || cliUUID.isEmpty) {
await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null);
}
});
}
@override