update
This commit is contained in:
+2
-2
@@ -13,7 +13,7 @@ import 'package:prosappco/src/screens/professional.dart';
|
||||
import 'package:prosappco/src/screens/professional_profile.dart';
|
||||
import 'package:prosappco/src/screens/professional_revision.dart';
|
||||
import 'package:prosappco/src/screens/profile.dart';
|
||||
import 'package:prosappco/src/screens/prueba.dart';
|
||||
import 'package:prosappco/src/screens/profile_pro.dart';
|
||||
import 'package:prosappco/src/screens/register.dart';
|
||||
import 'package:prosappco/src/screens/request_sent.dart';
|
||||
import 'package:prosappco/src/screens/service.dart';
|
||||
@@ -58,7 +58,7 @@ class MyApp extends StatelessWidget {
|
||||
'/nuevaPassword': (context) => NewPasswordScreen(),
|
||||
'/servicio': (context) => const ServiceScreen(),
|
||||
'/profesional': (context) => const ProfessionalScreen(),
|
||||
'/prueba': (context) => const PruebaScreen(),
|
||||
'/profilePro': (context) => const ProfilePro(),
|
||||
},
|
||||
onGenerateRoute: (settings) {
|
||||
throw Exception('Ruta desconocida: ${settings.name}');
|
||||
|
||||
@@ -292,7 +292,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
||||
} else if (user?.state == 'revision') {
|
||||
Navigator.pushNamed(context, '/profesionalRevision');
|
||||
} else if (user?.state == 'activo') {
|
||||
Navigator.pushNamed(context, '/prueba');
|
||||
Navigator.pushNamed(context, '/profilePro');
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
||||
@@ -1,27 +1,14 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/photo_view.dart';
|
||||
import 'package:prosappco/src/models/user_model.dart';
|
||||
import 'package:prosappco/src/screens/profile.dart';
|
||||
|
||||
class DrawerProfessional extends StatefulWidget {
|
||||
Reference? ref;
|
||||
String userName;
|
||||
String userPhoneNumber;
|
||||
String userCity;
|
||||
String userState;
|
||||
|
||||
DrawerProfessional({
|
||||
super.key,
|
||||
required this.ref,
|
||||
required this.userName,
|
||||
required this.userPhoneNumber,
|
||||
required this.userCity,
|
||||
required this.userState,
|
||||
});
|
||||
|
||||
@override
|
||||
State<DrawerProfessional> createState() => _DrawerProfessionalState();
|
||||
}
|
||||
@@ -55,7 +42,16 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const ProfileScreen();
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
title: Text(user?.name ?? '',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
subtitle: Column(
|
||||
|
||||
@@ -113,10 +113,10 @@ class _ProfessionScreenState extends State<ProfessionScreen> {
|
||||
body: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
child: TextField(
|
||||
controller: searchController,
|
||||
decoration: InputDecoration(
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Buscar su profesión',
|
||||
prefixIcon: Icon(Icons.assignment_ind_rounded),
|
||||
),
|
||||
|
||||
@@ -374,7 +374,7 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
|
||||
color: Color(0xFF2BA4EC),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.person,
|
||||
color: Colors.white,
|
||||
size: 90,
|
||||
|
||||
@@ -350,7 +350,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
label: 'Perfil'),
|
||||
drawer: DrawerMenu(),
|
||||
body: SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Center(
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:prosappco/src/components/drawer_professional.dart';
|
||||
|
||||
class ProfilePro extends StatefulWidget {
|
||||
const ProfilePro({super.key});
|
||||
|
||||
@override
|
||||
State<ProfilePro> createState() => _ProfileProState();
|
||||
}
|
||||
|
||||
class _ProfileProState extends State<ProfilePro> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool switchValue = false;
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
iconTheme: const IconThemeData(
|
||||
color: Colors.black,
|
||||
),
|
||||
title: const Text(
|
||||
'Perfil profesional',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
drawer: DrawerProfessional(),
|
||||
body: Center(
|
||||
child: Switch(
|
||||
value: switchValue,
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
switchValue = newValue;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/drawer_professional.dart';
|
||||
|
||||
class PruebaScreen extends StatefulWidget {
|
||||
const PruebaScreen({super.key});
|
||||
|
||||
@override
|
||||
State<PruebaScreen> createState() => _PruebaScreenState();
|
||||
}
|
||||
|
||||
class _PruebaScreenState extends State<PruebaScreen> {
|
||||
File? imagen_to_upload;
|
||||
|
||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||
|
||||
late final FirebaseAuth _auth;
|
||||
final FirebaseStorage storage = FirebaseStorage.instance;
|
||||
var photoTemp = '';
|
||||
var _ciudad = '...';
|
||||
var _photo = '...';
|
||||
var _estado = '...';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||
_auth = FirebaseAuth.instance;
|
||||
|
||||
final currentUser = _auth.currentUser;
|
||||
|
||||
if (_ciudad == '...') {
|
||||
AuthenticationRepository.instance
|
||||
.getCity(uid.toString())
|
||||
.then((String s) => setState(() {
|
||||
_ciudad = s;
|
||||
}));
|
||||
}
|
||||
|
||||
if (_photo == '...') {
|
||||
AuthenticationRepository.instance
|
||||
.getPhoto(uid.toString())
|
||||
.then((String s) => setState(() {
|
||||
_photo = s;
|
||||
}));
|
||||
}
|
||||
if (_estado == '...') {
|
||||
AuthenticationRepository.instance
|
||||
.getState(uid.toString())
|
||||
.then((String s) => setState(() {
|
||||
_estado = s;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final User? user = FirebaseAuth.instance.currentUser;
|
||||
String city = _ciudad.toString();
|
||||
String state = _estado.toString();
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
iconTheme: const IconThemeData(
|
||||
color: Colors.black,
|
||||
),
|
||||
title: const Text(
|
||||
'Perfil',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
drawer: DrawerProfessional(
|
||||
ref: storage.ref().child(_photo),
|
||||
userName: user?.displayName ?? '',
|
||||
userPhoneNumber: user?.phoneNumber ?? '',
|
||||
userCity: city,
|
||||
userState: state),
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user