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