From a760c3c863462da3d98de7b58bbe95a95951943d Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 17 Nov 2023 17:53:54 -0500 Subject: [PATCH] update --- images/pro_marke_android.png | Bin 0 -> 8302 bytes lib/src/presentation/screens/map/service.dart | 109 +++++++- .../presentation/screens/professional.dart | 251 +++++++++--------- .../presentation/screens/service_type.dart | 15 +- 4 files changed, 245 insertions(+), 130 deletions(-) create mode 100644 images/pro_marke_android.png diff --git a/images/pro_marke_android.png b/images/pro_marke_android.png new file mode 100644 index 0000000000000000000000000000000000000000..d196ffc60c9047e23cbf45d9931f4e94d32b6fa1 GIT binary patch literal 8302 zcmV-!Ad%mRP)^eRTwIUu$Fa0 zjcU}rLesSC%1=@uD4iFXCRwmfcrr0%N?0D=T4h?+mWcQrfCYR(;l> zbZV4Z+xdk_Yp6^p3t=sH47DhldmT+M^=BSToRYY_9MYze!+=yNY4^)?(vk&e=#VeB z{KD_Jns-dXGG@B#R!vi`qf-b9DQnWTJhnOHL2-nzj0*Jpj)Z5TJZPv^xMW_>sz0tc zx&vt%i4hl#$_M9Er0s-d%ymIl3poG~v!F?()~Q^YT;g@JPZ9qg3vI{J6ky_Te4!^r z`}y43XGpV^FhLf%pS0Tw1Q{Pa+f7%T>81rtlo@i&0_5#r^0ppI(vI#F*^FV$ ztz2%Wf6}&^zwP$m!X#<7lC_ix`t&?BrP3;NVbRc1;DLt7Xm5v3>!MM>D)Uj)C(;rgO~^y+gw^qqG(GgiSwhpCQbYB9Fm{A{e~2|0U2zV`YTe3qTYmTMx$E!Fi>u|@`ZC)A*w;3zdc-kA~&m``1O z^lT4(_ua5M?RA}&s3M2csnp-S@#V%tR!*{917T!T7+F8tnV=i~5G~knm|I=BAwnb3 zG}#GA?yr}5igIYrifR)4VI#sbK^X?t9pV<$=^?J{oD z6;|%aG-2ob+<&H~rHcw5I7Jr9&3}%WK4%-dpPuhdRupMmiN!D;QMLT+}skyfPB&E}7M@YN#L$$>iQjIQ}YTAG^MHow03tKh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z*>WG*jCAPO;odb@ZlL2i8t}&Bcg4=uSSD0XZ~RyocPp^~#C{;yB8l{!P~mF~?%a5& zcHX;Hw@r)PK~~?|58bSVhOix8gvZUG!CxpM2!Cn5J)EYxFZ>vuJm4$FC1o zO`S97IsKdkr8tPAhhE&;ch|@6iubgS=zAApwZE8iO_?$!qCXv@A`A^9DwQyrKYu

x#M7qqnT>zxReerGtZVUw&An zh$M@>3z;mrrBKBf8xocL)ERW9s`~nRFH4$O97vhD8TM$b#>ARcrot2JX;VJ(y^pY( zJV&keHRZby@DDCdGd;p+sj!9PzU!q}w-VgGXE7Z!_3 ze-M{(OC)b?ZEYQoFOV=4Y)a*2ptz#ZgRXC){7s@RCN~;R2fpJ<>RzuiR+;fkc9bF zfF(B~6m^q4J+icpOIcSjB3rh9v_ANez!})jYOU z>z_%&P^7y{J`WA4b#m#GkVq=dXV-_8M11dnwsRUs8hLMhl1%SEQP1>5py#U zTVwBuciy~t)ocm6aXvI4{SD5;(9o(*oEtc!%2q!2QTRB$)9w~NB{r;07*qoM6N<$f^cNU$p8QV literal 0 HcmV?d00001 diff --git a/lib/src/presentation/screens/map/service.dart b/lib/src/presentation/screens/map/service.dart index 877b79b..36a927f 100644 --- a/lib/src/presentation/screens/map/service.dart +++ b/lib/src/presentation/screens/map/service.dart @@ -147,15 +147,29 @@ class _ServiceScreenState extends State { _saveToken(); - BitmapDescriptor.fromAssetImage( - const ImageConfiguration(size: Size(1, 1)), 'images/pro_marke.png') - .then((icon) { - if (mounted) { - setState(() { - _markerIcon = icon; - }); - } - }); + if (Platform.isAndroid) { + BitmapDescriptor.fromAssetImage( + const ImageConfiguration(size: Size(2, 2)), + 'images/pro_marke_android.png', + ).then((icon) { + if (mounted) { + setState(() { + _markerIcon = icon; + }); + } + }); + } else { + BitmapDescriptor.fromAssetImage( + const ImageConfiguration(size: Size(1, 1)), + 'images/pro_marke.png', + ).then((icon) { + if (mounted) { + setState(() { + _markerIcon = icon; + }); + } + }); + } updateMarkersForServiceType(_serviceType); } @@ -177,6 +191,7 @@ class _ServiceScreenState extends State { Widget build(BuildContext context) { final userProvider = Provider.of(context); UserModel? user = userProvider.user; + dynamic datos; return SafeArea( child: Scaffold( @@ -328,6 +343,80 @@ class _ServiceScreenState extends State { updateMarkersForServiceType(_serviceType); }); + + datos = await Navigator.push( + context, + CupertinoPageRoute( + builder: (BuildContext context) { + return ProfessionalScreen( + profession: _serviceTypeController.text, + ); + }, + ), + ); + + if (datos != null) { + Professional? profesional = datos[0]; + ubicacion = datos[1]; + + if (profesional != null) { + if (mounted) { + setState(() { + _profesionalController.text = + profesional.name.toString(); + + professionalId = profesional.id; + + if (profesional.token != '') { + professionalToken = profesional.token!; + } + + professionalTarifa = + profesional.tarifa ?? 0; + + professionalUbicacion = + profesional.ubicacion; + + professionalLatitude = profesional.latitude; + professionalLongitude = + profesional.longitude; + + if (ubicacion == 'sitio') { + professionalAddress = + profesional.realAddress; + + _locacionController.text = + profesional.realAddress; + + LatLng professionalCoordinates = LatLng( + professionalLatitude!, + professionalLongitude!); + + if (professionalLatitude != null && + professionalLatitude != 0 && + professionalLongitude != null && + professionalLongitude != 0) { + _animateCameraToPosition( + LatLng(professionalLatitude!, + professionalLongitude!), + ); + + getPolylinePoints(_currentP!, + professionalCoordinates) + .then( + (coordinates) => { + generatePolyLineFromPoints( + coordinates), + }, + ); + } + } else { + polylines.clear(); + } + }); + } + } + } } } }, @@ -367,7 +456,7 @@ class _ServiceScreenState extends State { return; } - final dynamic datos = await Navigator.push( + datos = await Navigator.push( context, CupertinoPageRoute( builder: (BuildContext context) { diff --git a/lib/src/presentation/screens/professional.dart b/lib/src/presentation/screens/professional.dart index c4a3d48..7f5aaa4 100644 --- a/lib/src/presentation/screens/professional.dart +++ b/lib/src/presentation/screens/professional.dart @@ -300,127 +300,140 @@ class _ProfessionalScreenState extends State { ), ), ), - Expanded( - child: ListView.builder( - itemCount: professionals.length, - itemBuilder: (BuildContext context, int index) { - return ListTile( - leading: GestureDetector( - onTap: () { - Navigator.of(context).push( - CupertinoPageRoute( - builder: (BuildContext context) { - return ProfessionalInfoScreen( - professional: professionals[index], - ); - }, - ), - ); - }, - child: ReferencePhoto( - ref: professionals[index].professionalRef, - sizeCircle: 50, - size: 50, - sizeIcon: 35, - ), - ), - trailing: GestureDetector( - child: const Icon(Icons.keyboard_arrow_right), - onTap: () { - Navigator.of(context).push( - CupertinoPageRoute( - builder: (BuildContext context) { - return ProfessionalInfoScreen( - professional: professionals[index], - ); - }, - ), - ); - }, - ), - title: RichText( - text: TextSpan( - style: const TextStyle( - fontSize: 15.0, - color: Colors.black, - ), - children: [ - TextSpan( - text: '${professionals[index].name}, ', - style: const TextStyle(fontWeight: FontWeight.bold), - ), - TextSpan( - text: - "${professionals[index].professionName}, ${professionals[index].cityName}", - style: TextStyle(color: Colors.grey[600]), - ), - ], - ), - ), - subtitle: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - settings?.tarifas == true - ? professionals[index].tarifa == 0 - ? const SizedBox() - : Container( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - color: const Color(0xFFD6F4FF), - ), - child: Text( - formatCurrency( - professionals[index].tarifa ?? 0), - style: TextStyle( - color: Colors.grey[850], - fontWeight: FontWeight.w600, - ), - ), - ) - : const SizedBox(), - professionals[index].ubicacion == 'ambos' - ? Text( - 'Disponibilidad a domicilio y en sitio ${professionals[index].tarifa}', - style: const TextStyle( - color: Colors.blue, + professionals.isEmpty + ? Expanded( + child: Padding( + padding: + const EdgeInsets.only(left: 20, right: 20, top: 50), + child: + Text('Aún no tenemos ningun(a) ${widget.profession}'), + )) + : Expanded( + child: ListView.builder( + itemCount: professionals.length, + itemBuilder: (BuildContext context, int index) { + return ListTile( + leading: GestureDetector( + onTap: () { + Navigator.of(context).push( + CupertinoPageRoute( + builder: (BuildContext context) { + return ProfessionalInfoScreen( + professional: professionals[index], + ); + }, ), - ) - : professionals[index].ubicacion == 'sitio' - ? Text( - 'Disponibilidad en ${professionals[index].ubicacion} ', - style: const TextStyle( - color: Colors.blue, - ), - ) - : Text( - 'Disponibilidad a ${professionals[index].ubicacion}', - style: const TextStyle( - color: Colors.blue, - ), - ), - ], + ); + }, + child: ReferencePhoto( + ref: professionals[index].professionalRef, + sizeCircle: 50, + size: 50, + sizeIcon: 35, + ), + ), + trailing: GestureDetector( + child: const Icon(Icons.keyboard_arrow_right), + onTap: () { + Navigator.of(context).push( + CupertinoPageRoute( + builder: (BuildContext context) { + return ProfessionalInfoScreen( + professional: professionals[index], + ); + }, + ), + ); + }, + ), + title: RichText( + text: TextSpan( + style: const TextStyle( + fontSize: 15.0, + color: Colors.black, + ), + children: [ + TextSpan( + text: '${professionals[index].name}, ', + style: const TextStyle( + fontWeight: FontWeight.bold), + ), + TextSpan( + text: + "${professionals[index].professionName}, ${professionals[index].cityName}", + style: TextStyle(color: Colors.grey[600]), + ), + ], + ), + ), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + settings?.tarifas == true + ? professionals[index].tarifa == 0 + ? const SizedBox() + : Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 5), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(20.0), + color: const Color(0xFFD6F4FF), + ), + child: Text( + formatCurrency( + professionals[index].tarifa ?? + 0), + style: TextStyle( + color: Colors.grey[850], + fontWeight: FontWeight.w600, + ), + ), + ) + : const SizedBox(), + professionals[index].ubicacion == 'ambos' + ? Text( + 'Disponibilidad a domicilio y en sitio ${professionals[index].tarifa}', + style: const TextStyle( + color: Colors.blue, + ), + ) + : professionals[index].ubicacion == 'sitio' + ? Text( + 'Disponibilidad en ${professionals[index].ubicacion} ', + style: const TextStyle( + color: Colors.blue, + ), + ) + : Text( + 'Disponibilidad a ${professionals[index].ubicacion}', + style: const TextStyle( + color: Colors.blue, + ), + ), + ], + ), + onTap: () { + if (professionals[index].ubicacion == 'ambos') { + _showChoiceDialog(context).then((String? value) { + if (value != null) { + Navigator.pop( + context, [professionals[index], value]); + } + }); + } else if (professionals[index].ubicacion == + 'sitio') { + Navigator.pop( + context, [professionals[index], 'sitio']); + } else { + Navigator.pop( + context, [professionals[index], 'domicilio']); + } + }, + ); + }, ), - onTap: () { - if (professionals[index].ubicacion == 'ambos') { - _showChoiceDialog(context).then((String? value) { - if (value != null) { - Navigator.pop( - context, [professionals[index], value]); - } - }); - } else if (professionals[index].ubicacion == 'sitio') { - Navigator.pop(context, [professionals[index], 'sitio']); - } else { - Navigator.pop( - context, [professionals[index], 'domicilio']); - } - }, - ); - }, - ), - ), + ), ], ), ), diff --git a/lib/src/presentation/screens/service_type.dart b/lib/src/presentation/screens/service_type.dart index daba9bc..47fc79b 100644 --- a/lib/src/presentation/screens/service_type.dart +++ b/lib/src/presentation/screens/service_type.dart @@ -1,7 +1,9 @@ import 'package:diacritic/diacritic.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:prosappco/src/components/pop_appbar.dart'; import 'package:prosappco/src/presentation/screens/profession.dart'; +import 'package:prosappco/src/presentation/screens/professional.dart'; class ServiceTypeScreen extends StatefulWidget { const ServiceTypeScreen({super.key}); @@ -52,7 +54,7 @@ class _ServiceTypeScreenState extends State { ), ); } - var professions = filteredProfessions!; + List professions = filteredProfessions!; return Scaffold( appBar: PopAppbar( @@ -86,6 +88,17 @@ class _ServiceTypeScreenState extends State { ), onTap: () { Navigator.pop(context, professions[index]); + + // Navigator.push( + // context, + // CupertinoPageRoute( + // builder: (BuildContext context) { + // return ProfessionalScreen( + // profession: professions[index], + // ); + // }, + // ), + // ); }, ); },