This commit is contained in:
lizandrogd
2023-12-03 12:42:05 -05:00
5 changed files with 85 additions and 6 deletions
@@ -96,7 +96,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
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<ServiceScreen> {
});
}
},
);
).catchError((error) {
print('App version Error al obtener la configuración: $error');
});
}
if (_ciudad == '...') {
@@ -1022,7 +1024,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
}
void _checkForUpdate(String? settings) {
if (appVersion == settings) {
if (appVersion != settings) {
showDialog(
context: context,
builder: (context) {
+31 -3
View File
@@ -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<ProfessionalScreen> {
@override
Widget build(BuildContext context) {
if (filteredProfessionals == null) {
return const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(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();
},
),
),
],
),
),
);
}
@@ -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,
),
),
);
}
}
+8
View File
@@ -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:
+2
View File
@@ -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: