From 80a9713e9cc1bc1bf4bc8fa7b05c302f4502faad Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 1 Dec 2023 09:44:30 -0500 Subject: [PATCH 1/3] 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) { From 19ef57c0da048a1f219da1ad5a9f1aaa202aa428 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 1 Dec 2023 09:46:46 -0500 Subject: [PATCH 2/3] update version limpiar prints --- lib/src/presentation/screens/map/service.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/src/presentation/screens/map/service.dart b/lib/src/presentation/screens/map/service.dart index fe750e8..7c95ce9 100644 --- a/lib/src/presentation/screens/map/service.dart +++ b/lib/src/presentation/screens/map/service.dart @@ -1012,16 +1012,12 @@ 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); } From 221a59b5f519f5b4f2ee2aea03145399923f7571 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 1 Dec 2023 12:17:12 -0500 Subject: [PATCH 3/3] update --- .../presentation/screens/professional.dart | 34 ++++++++++++++-- .../widgets/shared/loading_item_list.dart | 39 +++++++++++++++++++ pubspec.lock | 8 ++++ pubspec.yaml | 2 + 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 lib/src/presentation/widgets/shared/loading_item_list.dart diff --git a/lib/src/presentation/screens/professional.dart b/lib/src/presentation/screens/professional.dart index 7f5aaa4..f4bc92b 100644 --- a/lib/src/presentation/screens/professional.dart +++ b/lib/src/presentation/screens/professional.dart @@ -10,6 +10,7 @@ import 'package:prosappco/src/components/pop_appbar.dart'; import 'package:prosappco/src/models/setting_model.dart'; import 'package:prosappco/src/models/user_model.dart'; import 'package:prosappco/src/presentation/screens/professional_info.dart'; +import 'package:prosappco/src/presentation/widgets/shared/loading_item_list.dart'; import '../../models/scores_model.dart'; class ProfessionalScreen extends StatefulWidget { @@ -273,9 +274,36 @@ class _ProfessionalScreenState extends State { @override Widget build(BuildContext context) { if (filteredProfessionals == null) { - return const Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Color(0xFF2BA4EC)), + return SafeArea( + child: Scaffold( + appBar: PopAppbar( + onPressed: () { + Navigator.pop(context); + }, + label: 'Seleccione un profesional', + ), + body: Column( + children: [ + const Padding( + padding: EdgeInsets.all(10), + child: TextField( + readOnly: true, + decoration: InputDecoration( + hintText: 'Escriba un nombre', + prefixIcon: Icon(Icons.assignment_ind_rounded), + ), + ), + ), + Expanded( + child: ListView.builder( + itemCount: 8, + itemBuilder: (BuildContext context, int index) { + return const LoadingItemList(); + }, + ), + ), + ], + ), ), ); } diff --git a/lib/src/presentation/widgets/shared/loading_item_list.dart b/lib/src/presentation/widgets/shared/loading_item_list.dart new file mode 100644 index 0000000..94018ec --- /dev/null +++ b/lib/src/presentation/widgets/shared/loading_item_list.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; + +class LoadingItemList extends StatelessWidget { + const LoadingItemList({super.key}); + + @override + Widget build(BuildContext context) { + return Shimmer.fromColors( + baseColor: Colors.grey[300]!, + highlightColor: Colors.grey[100]!, + child: ListTile( + leading: const CircleAvatar( + radius: 25, + backgroundColor: Colors.white, + ), + title: Container( + height: 20, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + ), + subtitle: Container( + height: 15, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + ), + trailing: const Icon( + Icons.chevron_right, + color: Colors.white, + size: 30, + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 88a1cad..f1f7255 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1037,6 +1037,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + shimmer: + dependency: "direct main" + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" simple_gesture_detector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3e8e561..2d9306a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,6 +69,8 @@ dependencies: firebase_messaging: ^14.6.3 animated_splash_screen: ^1.3.0 animate_do: ^3.0.2 + shimmer: ^3.0.0 + dev_dependencies: flutter_test: