Update
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_connect/http/src/utils/utils.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/photo_view.dart';
|
||||
import 'package:prosappco/src/components/pop_appbar.dart';
|
||||
@@ -453,198 +454,201 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
|
||||
final User? user = FirebaseAuth.instance.currentUser;
|
||||
|
||||
String profession = _profession.toString();
|
||||
|
||||
double _space = 10;
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: PopAppbar(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
label: 'Perfil profesional'),
|
||||
body: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showChoiceDialog(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 25),
|
||||
child: (imagen_to_upload != null)
|
||||
? LocalPhoto(
|
||||
file: imagen_to_upload!,
|
||||
)
|
||||
: ReferencePhoto(
|
||||
ref: storage.ref().child(_photo),
|
||||
size: 100,
|
||||
sizeCircle: 100,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showChoiceDialog(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 25),
|
||||
child: (imagen_to_upload != null)
|
||||
? LocalPhoto(
|
||||
file: imagen_to_upload!,
|
||||
)
|
||||
: ReferencePhoto(
|
||||
ref: storage.ref().child(_photo),
|
||||
size: 100,
|
||||
sizeCircle: 100,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 300,
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _cedulaController,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.person_outline),
|
||||
hintText: 'Cedula (Obligatorio)'),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_showChoiceDialogCedula(context);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Cedula',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
Container(
|
||||
width: 300,
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _cedulaController,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.person_outline),
|
||||
hintText: 'Cedula (Obligatorio)'),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_showChoiceDialogCedula(context);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Cedula',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
Icon(
|
||||
image_cedula != null
|
||||
? Icons.check
|
||||
: Icons.file_upload_outlined,
|
||||
color: Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
Icon(
|
||||
image_cedula != null
|
||||
? Icons.check
|
||||
: Icons.file_upload_outlined,
|
||||
color: Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
elevation: 0,
|
||||
minimumSize: Size(250, 50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: Size(250, 50),
|
||||
),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final String? profesion = (await Navigator.pushNamed(
|
||||
context, '/profession')) as String?;
|
||||
SizedBox(height: _space),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final String? profesion =
|
||||
(await Navigator.pushNamed(
|
||||
context, '/profession')) as String?;
|
||||
|
||||
if (profesion != null) {
|
||||
if (profesion != null) {
|
||||
setState(() {
|
||||
_profession = profesion;
|
||||
});
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
prefixIcon:
|
||||
const Icon(Icons.assignment_ind_rounded),
|
||||
suffixIcon: const Icon(Icons.arrow_drop_down),
|
||||
hintStyle: profession == ''
|
||||
? const TextStyle()
|
||||
: const TextStyle(color: Colors.black87),
|
||||
hintText: profession == ''
|
||||
? 'Profesión (Obligatorio)'
|
||||
: profession),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_showChoiceDialogCertificado(context);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(250, 50),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Certificado profesional',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Icon(
|
||||
image_certificado != null
|
||||
? Icons.check
|
||||
: Icons.file_upload_outlined,
|
||||
color: const Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
TextFormField(
|
||||
controller: _especializacionController,
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.assignment_ind_rounded),
|
||||
hintText: 'Especialización'),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final images = await getImage(3);
|
||||
setState(() {
|
||||
_profession = profesion;
|
||||
images_especializacion =
|
||||
images.map((e) => File(e!.path)).toList();
|
||||
});
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
prefixIcon:
|
||||
const Icon(Icons.assignment_ind_rounded),
|
||||
suffixIcon: const Icon(Icons.arrow_drop_down),
|
||||
hintStyle: profession == ''
|
||||
? const TextStyle()
|
||||
: const TextStyle(color: Colors.black87),
|
||||
hintText: profession == ''
|
||||
? 'Profesión (Obligatorio)'
|
||||
: profession),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_showChoiceDialogCertificado(context);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(250, 50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(250, 50),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Certificado profesional',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Especialización',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Icon(
|
||||
image_certificado != null
|
||||
? Icons.check
|
||||
: Icons.file_upload_outlined,
|
||||
color: const Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
TextFormField(
|
||||
controller: _especializacionController,
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.assignment_ind_rounded),
|
||||
hintText: 'Especialización'),
|
||||
),
|
||||
SizedBox(height: _space),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final images = await getImage(3);
|
||||
setState(() {
|
||||
images_especializacion =
|
||||
images.map((e) => File(e!.path)).toList();
|
||||
});
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFD6F4FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
const SizedBox(width: 15),
|
||||
Icon(
|
||||
images_especializacion.isEmpty
|
||||
? Icons.file_upload_outlined
|
||||
: Icons.check,
|
||||
color: const Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(250, 50),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Especialización',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF2BA4EC),
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Icon(
|
||||
images_especializacion.isEmpty
|
||||
? Icons.file_upload_outlined
|
||||
: Icons.check,
|
||||
color: const Color(0xFF2BA4EC),
|
||||
size: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
],
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
margin: const EdgeInsets.only(top: 120, right: 70, left: 70),
|
||||
margin: const EdgeInsets.only(
|
||||
top: 80, right: 70, left: 70, bottom: 30),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
sendInfo();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFF2BA4EC),
|
||||
backgroundColor: const Color(0xFF2BA4EC),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
@@ -670,8 +674,10 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user