diff --git a/lib/src/presentation/screens/map/service.dart b/lib/src/presentation/screens/map/service.dart index 36a927f..7c95ce9 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 == '...') { @@ -1022,7 +1024,7 @@ class _ServiceScreenState extends State { } void _checkForUpdate(String? settings) { - if (appVersion == settings) { + if (appVersion != settings) { showDialog( context: context, builder: (context) { 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 606f2c4..841391a 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: