update 15 dec

This commit is contained in:
Felipe
2023-12-15 16:04:01 -05:00
parent aaf82b4072
commit d651b140fb
9 changed files with 160 additions and 52 deletions
+10 -5
View File
@@ -94,9 +94,12 @@ class _ServiceScreenState extends State<ServiceScreen> {
getLocationUpdates();
print('App version: 2 $settings');
if (settings == null) {
SettingModel.getSettings().then(
(SettingModel value) {
(SettingModel value) => (value) {
print('App version:3 $value');
if (mounted) {
setState(() {
settings = value.version;
@@ -104,9 +107,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
});
}
},
).catchError((error) {
print('App version Error al obtener la configuración: $error');
});
);
}
if (_ciudad == '...') {
@@ -1012,19 +1013,23 @@ class _ServiceScreenState extends State<ServiceScreen> {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
print('App version: $version');
if (mounted) {
setState(() {
appVersion = version;
});
}
print('App version: $settings');
if (settings != null) {
_checkForUpdate(settings);
}
}
void _checkForUpdate(String? settings) {
if (appVersion != settings) {
if (appVersion == settings) {
showDialog(
context: context,
builder: (context) {