From 80a9713e9cc1bc1bf4bc8fa7b05c302f4502faad Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 1 Dec 2023 09:44:30 -0500 Subject: [PATCH] version --- lib/src/presentation/screens/map/service.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/src/presentation/screens/map/service.dart b/lib/src/presentation/screens/map/service.dart index 36a927f..fe750e8 100644 --- a/lib/src/presentation/screens/map/service.dart +++ b/lib/src/presentation/screens/map/service.dart @@ -96,7 +96,7 @@ class _ServiceScreenState extends State { if (settings == null) { SettingModel.getSettings().then( - (SettingModel value) => (value) { + (SettingModel value) { if (mounted) { setState(() { settings = value.version; @@ -104,7 +104,9 @@ class _ServiceScreenState extends State { }); } }, - ); + ).catchError((error) { + print('App version Error al obtener la configuración: $error'); + }); } if (_ciudad == '...') { @@ -1010,19 +1012,23 @@ class _ServiceScreenState extends State { 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) {