fix
This commit is contained in:
@@ -16,9 +16,7 @@ class UserProvider extends ChangeNotifier {
|
||||
|
||||
void initUserProvider() {
|
||||
var uid = FirebaseAuth.instance.currentUser?.uid;
|
||||
print('DesdeProvider $uid');
|
||||
if (uid == null) return;
|
||||
print('initUserProvider');
|
||||
_stream = _firestore.collection('users').doc(uid).snapshots();
|
||||
_stream?.listen((documentSnapshot) async {
|
||||
if (documentSnapshot.exists) {
|
||||
@@ -27,11 +25,7 @@ class UserProvider extends ChangeNotifier {
|
||||
_score = await ScoresModel.scoreTo(uid, false, false);
|
||||
notifyListeners();
|
||||
}
|
||||
}, onDone: () {
|
||||
print("Task Done");
|
||||
}, onError: (error) {
|
||||
print("Some Error");
|
||||
});
|
||||
}, onDone: () {}, onError: (error) {});
|
||||
}
|
||||
|
||||
void setNullUser() {
|
||||
|
||||
@@ -18,7 +18,6 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:community_material_icon/community_material_icon.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
class CitaScreen extends StatefulWidget {
|
||||
final Event evento;
|
||||
@@ -291,7 +290,7 @@ class _CitaScreenState extends State<CitaScreen> {
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
textAlign: TextAlign.center,
|
||||
'" ${widget.evento.description} "',
|
||||
'" ${widget.evento.description?.trim()} "',
|
||||
style: const TextStyle(
|
||||
color: Colors.grey, fontStyle: FontStyle.italic),
|
||||
),
|
||||
@@ -481,7 +480,7 @@ class _CitaScreenState extends State<CitaScreen> {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.blue,
|
||||
content: const Text(
|
||||
'Primero acepta la solicitud',
|
||||
'El profesional no ha aceptado tu solicitud',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -583,8 +582,9 @@ class _CitaScreenState extends State<CitaScreen> {
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: Text('${widget.evento.address}'))
|
||||
width: 200,
|
||||
child: Text('${widget.evento.address}'),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -102,7 +102,11 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
await AuthenticationRepository.instance
|
||||
.signInWithGoogle();
|
||||
.signInWithGoogle()
|
||||
.then((value) => {
|
||||
Provider.of<UserProvider>(context)
|
||||
.initUserProvider()
|
||||
});
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF2BA4EC),
|
||||
@@ -315,60 +319,6 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 0, vertical: 20),
|
||||
child: Column(children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(bottom: 20),
|
||||
// child: ElevatedButton(
|
||||
// onPressed: () async {
|
||||
// await AuthenticationRepository.instance
|
||||
// .signInWithGoogle();
|
||||
// },
|
||||
// style: ElevatedButton.styleFrom(
|
||||
// backgroundColor: const Color(0xFF2BA4EC),
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(50),
|
||||
// ),
|
||||
// elevation: 0,
|
||||
// minimumSize: const Size(230, 60),
|
||||
// ),
|
||||
// child: const Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Entrar con Google ',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// fontSize: 18,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 5),
|
||||
// FaIcon(FontAwesomeIcons.google),
|
||||
// ],
|
||||
// )),
|
||||
// ),
|
||||
// const Padding(
|
||||
// padding: EdgeInsets.symmetric(vertical: 5),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Divider(
|
||||
// color: Colors.black38,
|
||||
// thickness: 1,
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
// child: Text("ó"),
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Divider(
|
||||
// color: Colors.black38,
|
||||
// thickness: 1,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(bottom: 5),
|
||||
child: Align(
|
||||
@@ -453,7 +403,7 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
// Agrega aquí la lógica para manejar la recuperación de contraseña
|
||||
Navigator.pushNamed(context, '/resetpassword');
|
||||
},
|
||||
child: const Text(
|
||||
'Olvidé la contraseña',
|
||||
@@ -554,21 +504,22 @@ class PaddingButtomBottom extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 40),
|
||||
child: Center(
|
||||
child: PrimaryButtom(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
LoginEmailController.instance
|
||||
.loginUser(
|
||||
controller.email.text.trim(),
|
||||
controller.password.text.trim(),
|
||||
)
|
||||
.then((value) {
|
||||
Provider.of<UserProvider>(context).initUserProvider();
|
||||
});
|
||||
}
|
||||
},
|
||||
label: 'Iniciar'),
|
||||
),
|
||||
child: PrimaryButtom(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
LoginEmailController.instance
|
||||
.loginUser(
|
||||
controller.email.text.trim(),
|
||||
controller.password.text.trim(),
|
||||
)
|
||||
.then((value) {
|
||||
Provider.of<UserProvider>(context, listen: false)
|
||||
.initUserProvider();
|
||||
});
|
||||
}
|
||||
},
|
||||
label: 'Iniciar',
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,10 +104,16 @@ class MyServicesProScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
leading: event.status == 'aprobado'
|
||||
? const Icon(
|
||||
Icons.check,
|
||||
color: Colors.blue,
|
||||
size: 40,
|
||||
? const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: Colors.blue,
|
||||
size: 30,
|
||||
),
|
||||
Text('Aceptado', style: TextStyle(fontSize: 12)),
|
||||
],
|
||||
)
|
||||
: event.status == 'iniciado'
|
||||
? const Icon(
|
||||
|
||||
Reference in New Issue
Block a user