puntaje pro
This commit is contained in:
+184
-195
@@ -10,6 +10,7 @@ import 'package:get/get.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/banner_photo.dart';
|
||||
import 'package:prosappco/src/components/drawer_professional.dart';
|
||||
import 'package:prosappco/src/components/pop_appbar.dart';
|
||||
import 'package:prosappco/src/components/primary_btn.dart';
|
||||
import 'package:prosappco/src/components/schedule_picker.dart';
|
||||
import 'package:prosappco/src/screens/horario.dart';
|
||||
@@ -258,217 +259,205 @@ class _ProfileProState extends State<ProfilePro> {
|
||||
Widget build(BuildContext context) {
|
||||
String address = _direccion.toString();
|
||||
|
||||
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: SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showChoiceDialog(context);
|
||||
},
|
||||
child: Container(
|
||||
child: (imagen_to_upload != null)
|
||||
? LocalPhoto(
|
||||
file: imagen_to_upload!,
|
||||
)
|
||||
: ReferenceBannerPhoto(
|
||||
ref: storage.ref().child(_photo),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: Colors.white,
|
||||
height: 12,
|
||||
),
|
||||
customSwitch(
|
||||
'Servicio a domicilio',
|
||||
domicilioValue,
|
||||
(value) {
|
||||
domicilioValue = value;
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
customSwitch(
|
||||
'Servicio en sitio',
|
||||
sitioValue,
|
||||
(value) {
|
||||
sitioValue = value;
|
||||
},
|
||||
),
|
||||
sitioValue
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 40, right: 40, bottom: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
// controller: _emailController,
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final String? direccion = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const ProfessionalDireccionScreen();
|
||||
},
|
||||
),
|
||||
) as String?;
|
||||
|
||||
if (direccion != null) {
|
||||
setState(() {
|
||||
_direccion = direccion;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.near_me),
|
||||
hintStyle: address == ''
|
||||
? const TextStyle()
|
||||
: const TextStyle(color: Colors.black87),
|
||||
hintText:
|
||||
address == '' ? 'Dirección' : address),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _opcionalAddressController,
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Oficina / Piso / Conjunto'),
|
||||
),
|
||||
],
|
||||
return Scaffold(
|
||||
appBar: PopAppbar(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
label: 'Perfil profesional'),
|
||||
body: SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showChoiceDialog(context);
|
||||
},
|
||||
child: Container(
|
||||
child: (imagen_to_upload != null)
|
||||
? LocalPhoto(
|
||||
file: imagen_to_upload!,
|
||||
)
|
||||
.animate()
|
||||
.moveY(duration: const Duration(milliseconds: 100)),
|
||||
: ReferenceBannerPhoto(
|
||||
ref: storage.ref().child(_photo),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: Colors.white,
|
||||
height: 12,
|
||||
),
|
||||
customSwitch(
|
||||
'Servicio a domicilio',
|
||||
domicilioValue,
|
||||
(value) {
|
||||
domicilioValue = value;
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
customSwitch(
|
||||
'Servicio en sitio',
|
||||
sitioValue,
|
||||
(value) {
|
||||
sitioValue = value;
|
||||
},
|
||||
),
|
||||
sitioValue
|
||||
? Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 40, right: 40, bottom: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
// controller: _emailController,
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final String? direccion = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const ProfessionalDireccionScreen();
|
||||
},
|
||||
),
|
||||
) as String?;
|
||||
|
||||
if (direccion != null) {
|
||||
setState(() {
|
||||
_direccion = direccion;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.near_me),
|
||||
hintStyle: address == ''
|
||||
? const TextStyle()
|
||||
: const TextStyle(color: Colors.black87),
|
||||
hintText: address == '' ? 'Dirección' : address),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _opcionalAddressController,
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Oficina / Piso / Conjunto'),
|
||||
),
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
const Divider(),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
'Horario estandar',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 15,
|
||||
),
|
||||
.animate()
|
||||
.moveY(duration: const Duration(milliseconds: 100)),
|
||||
)
|
||||
: const SizedBox(),
|
||||
const Divider(),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
'Horario estandar',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return HorarioScreen(
|
||||
horarios: _horarios!,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: const [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 30),
|
||||
child: Text(
|
||||
'Dia',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 170),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return HorarioScreen(
|
||||
horarios: _horarios!,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: const [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 30),
|
||||
child: Text(
|
||||
'Hora',
|
||||
'Dia',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 45),
|
||||
child: Icon(Icons.edit_outlined),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 170),
|
||||
child: Text(
|
||||
'Hora',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 45),
|
||||
child: Icon(Icons.edit_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: sitioValue
|
||||
? const EdgeInsets.only(bottom: 30)
|
||||
: const EdgeInsets.only(bottom: 70),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 30),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text('Lunes'),
|
||||
Text('Martes'),
|
||||
Text('Miércoles'),
|
||||
Text('Jueves'),
|
||||
Text('Viernes'),
|
||||
Text('Sábado'),
|
||||
Text('Domingo'),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: sitioValue
|
||||
? const EdgeInsets.only(bottom: 30)
|
||||
: const EdgeInsets.only(bottom: 70),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 30),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text('Lunes'),
|
||||
Text('Martes'),
|
||||
Text('Miércoles'),
|
||||
Text('Jueves'),
|
||||
Text('Viernes'),
|
||||
Text('Sábado'),
|
||||
Text('Domingo'),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 25),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(timeList(_horarios?['Lunes'], context)),
|
||||
Text(timeList(_horarios?['Martes'], context)),
|
||||
Text(
|
||||
timeList(_horarios?['Miercoles'], context)),
|
||||
Text(timeList(_horarios?['Jueves'], context)),
|
||||
Text(timeList(_horarios?['Viernes'], context)),
|
||||
Text(timeList(_horarios?['Sabado'], context)),
|
||||
Text(timeList(_horarios?['Domingo'], context)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 25),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(timeList(_horarios?['Lunes'], context)),
|
||||
Text(timeList(_horarios?['Martes'], context)),
|
||||
Text(timeList(_horarios?['Miercoles'], context)),
|
||||
Text(timeList(_horarios?['Jueves'], context)),
|
||||
Text(timeList(_horarios?['Viernes'], context)),
|
||||
Text(timeList(_horarios?['Sabado'], context)),
|
||||
Text(timeList(_horarios?['Domingo'], context)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
PrimaryButtom(
|
||||
onPressed: () {
|
||||
updateInfo();
|
||||
},
|
||||
label: 'Guardar'),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PrimaryButtom(
|
||||
onPressed: () {
|
||||
updateInfo();
|
||||
},
|
||||
label: 'Guardar'),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -515,7 +504,7 @@ class _ProfileProState extends State<ProfilePro> {
|
||||
return 'N/A';
|
||||
}
|
||||
if (schedule.jornadaContinua) {
|
||||
return '${schedule.range1Hour1?.format(context).toString()} - ${schedule.range1Hour2?.format(context).toString()}';
|
||||
return '${schedule.range1Hour1?.format(context).toString()} - ${schedule.range2Hour2?.format(context).toString()}';
|
||||
} else {
|
||||
return '${schedule.range1Hour1?.format(context).toString()} - ${schedule.range1Hour2?.format(context).toString()}; ${schedule.range2Hour1?.format(context).toString()} - ${schedule.range2Hour2?.format(context).toString()}';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user