fix campos
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -26,6 +25,8 @@ import 'package:prosappco/src/presentation/screens/service_type.dart';
|
|||||||
import 'package:prosappco/src/presentation/widgets/shared/drawer_menu.dart';
|
import 'package:prosappco/src/presentation/widgets/shared/drawer_menu.dart';
|
||||||
import 'package:prosappco/src/presentation/widgets/shared/primary_button.dart';
|
import 'package:prosappco/src/presentation/widgets/shared/primary_button.dart';
|
||||||
import 'package:prosappco/src/presentation/widgets/shared/warning_snackbar.dart';
|
import 'package:prosappco/src/presentation/widgets/shared/warning_snackbar.dart';
|
||||||
|
import 'package:prosappco/src/providers/user_provider.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class ServiceScreen extends StatefulWidget {
|
class ServiceScreen extends StatefulWidget {
|
||||||
@@ -81,23 +82,12 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
|||||||
|
|
||||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||||
|
|
||||||
UserModel? user;
|
|
||||||
String? settings;
|
String? settings;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
UserModel.getUser(uid.toString()).then(
|
|
||||||
(UserModel s) => (value) {
|
|
||||||
if (mounted) {
|
|
||||||
setState(() => user = s);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
_getAppVersion();
|
_getAppVersion();
|
||||||
|
|
||||||
getLocationUpdates().then(
|
getLocationUpdates().then(
|
||||||
@@ -191,15 +181,16 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final userProvider = Provider.of<UserProvider>(context);
|
||||||
|
UserModel? user = userProvider.user;
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
drawer: DrawerMenu(),
|
drawer: DrawerMenu(),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _currentP == null
|
child: Stack(
|
||||||
? const Center(child: CircularProgressIndicator())
|
|
||||||
: Stack(
|
|
||||||
children: [
|
children: [
|
||||||
GoogleMap(
|
GoogleMap(
|
||||||
onMapCreated: ((GoogleMapController controller) {
|
onMapCreated: ((GoogleMapController controller) {
|
||||||
@@ -213,28 +204,29 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
|||||||
),
|
),
|
||||||
markers: {
|
markers: {
|
||||||
...markers,
|
...markers,
|
||||||
|
if (_currentP != null)
|
||||||
Marker(
|
Marker(
|
||||||
markerId: const MarkerId("_currentLocation"),
|
markerId: const MarkerId("_currentLocation"),
|
||||||
icon: BitmapDescriptor.defaultMarker,
|
icon: BitmapDescriptor.defaultMarker,
|
||||||
position: _currentP!,
|
position: _currentP!,
|
||||||
),
|
),
|
||||||
const Marker(
|
// const Marker(
|
||||||
markerId: MarkerId("_sourceLocation"),
|
// markerId: MarkerId("_sourceLocation"),
|
||||||
icon: BitmapDescriptor.defaultMarker,
|
// icon: BitmapDescriptor.defaultMarker,
|
||||||
position: _pGooglePlex,
|
// position: _pGooglePlex,
|
||||||
),
|
// ),
|
||||||
const Marker(
|
// const Marker(
|
||||||
markerId: MarkerId("_destionationLocation"),
|
// markerId: MarkerId("_destionationLocation"),
|
||||||
icon: BitmapDescriptor.defaultMarker,
|
// icon: BitmapDescriptor.defaultMarker,
|
||||||
position: _pApplePark,
|
// position: _pApplePark,
|
||||||
),
|
// ),
|
||||||
},
|
},
|
||||||
polylines: Set<Polyline>.of(polylines.values),
|
polylines: Set<Polyline>.of(polylines.values),
|
||||||
onCameraIdle: () {
|
onCameraIdle: () {
|
||||||
if (professionalAddress == '') {
|
if (professionalAddress == '') {
|
||||||
if (coordinates != null) {
|
if (coordinates != null) {
|
||||||
getLocationName(coordinates.latitude,
|
getLocationName(
|
||||||
coordinates.longitude)
|
coordinates.latitude, coordinates.longitude)
|
||||||
.then((locationName) {
|
.then((locationName) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
Reference in New Issue
Block a user