chat primera face
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:community_material_icon/community_material_icon.dart';
|
||||
import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -88,7 +89,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: now,
|
||||
firstDate: DateTime(now.year),
|
||||
firstDate: now,
|
||||
lastDate: DateTime(now.year + 1),
|
||||
// builder: (context, child) {
|
||||
// return Theme(data: ThemeData.dark(), child: child!);
|
||||
@@ -130,10 +131,19 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
final FirebaseStorage storage = FirebaseStorage.instance;
|
||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||
|
||||
BitmapDescriptor? _markerIcon;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
BitmapDescriptor.fromAssetImage(
|
||||
ImageConfiguration(size: Size(48, 48)), 'images/pro_marke.png')
|
||||
.then((icon) {
|
||||
setState(() {
|
||||
_markerIcon = icon;
|
||||
});
|
||||
});
|
||||
try {
|
||||
getUsersWithActiveStatus().then((value) {
|
||||
for (var doc in value) {
|
||||
@@ -142,6 +152,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
if (element['latitude'] != null && element['longitude'] != null) {
|
||||
markers.add(
|
||||
Marker(
|
||||
icon: _markerIcon!,
|
||||
markerId: MarkerId(doc.id),
|
||||
position: LatLng(
|
||||
element['latitude'],
|
||||
@@ -448,7 +459,29 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
width: 180,
|
||||
child: TextFormField(
|
||||
onTap: () {
|
||||
_selectDate(context);
|
||||
if (_profesionalController
|
||||
.text.isNotEmpty) {
|
||||
_selectDate(context);
|
||||
} else {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.blue,
|
||||
content: const Text(
|
||||
'Selecciona un profesional',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
elevation: 8.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.0),
|
||||
),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(snackBar);
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
@@ -469,7 +502,29 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
width: 140,
|
||||
child: TextFormField(
|
||||
onTap: () {
|
||||
_selectTime(context);
|
||||
if (_profesionalController
|
||||
.text.isNotEmpty) {
|
||||
_selectTime(context);
|
||||
} else {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.blue,
|
||||
content: const Text(
|
||||
'Selecciona un profesional',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
elevation: 8.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.0),
|
||||
),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(snackBar);
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
decoration: const InputDecoration(
|
||||
@@ -508,21 +563,21 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
UserModel.getUser(uid.toString()).then((value) {
|
||||
eventoService
|
||||
.createEvent(
|
||||
value.name,
|
||||
_observacionController.text,
|
||||
'${_selectedDate}Z',
|
||||
_selectedTime!.format(context),
|
||||
time2.format(context),
|
||||
professionalId,
|
||||
ubicacion,
|
||||
_locationController.text,
|
||||
ubicacion != 'sitio'
|
||||
? coordinates.latitude
|
||||
: professionalLatitude,
|
||||
ubicacion != 'sitio'
|
||||
? coordinates.longitude
|
||||
: professionalLongitude,
|
||||
)
|
||||
value.name,
|
||||
_observacionController.text,
|
||||
'${_selectedDate}Z',
|
||||
_selectedTime!.format(context),
|
||||
time2.format(context),
|
||||
professionalId,
|
||||
ubicacion,
|
||||
_locationController.text,
|
||||
ubicacion != 'sitio'
|
||||
? coordinates.latitude
|
||||
: professionalLatitude,
|
||||
ubicacion != 'sitio'
|
||||
? coordinates.longitude
|
||||
: professionalLongitude,
|
||||
'pendiente')
|
||||
.then((value) {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
||||
Reference in New Issue
Block a user