historial y pendientes
This commit is contained in:
@@ -56,175 +56,197 @@ class _ProfessionalFormScreenState extends State<ProfessionalFormScreen> {
|
||||
),
|
||||
body: BlocBuilder<MyUserBloc, MyUserState>(
|
||||
builder: (context, state) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 40, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
pictureWidget(state, context),
|
||||
const SizedBox(height: 30),
|
||||
TextFormField(
|
||||
controller: _cedulaController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Cedula',
|
||||
prefixIcon: Icon(Icons.assignment_ind),
|
||||
hintText: 'Ingresa tu cedula',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, ingrese su nombre';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickCedulaPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 40, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Text('Cargar pdf de la cedula'),
|
||||
_cedulaPdfFile != null
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
TextFormField(
|
||||
controller: _professionController,
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final professionName = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const ProfessionListScreen();
|
||||
pictureWidget(state, context),
|
||||
const SizedBox(height: 30),
|
||||
TextFormField(
|
||||
controller: _cedulaController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Cedula',
|
||||
prefixIcon: Icon(Icons.assignment_ind),
|
||||
hintText: 'Ingresa tu cedula',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, ingrese su nombre';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (professionName != null) {
|
||||
_professionController.text = professionName;
|
||||
}
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Profesión',
|
||||
prefixIcon: Icon(Icons.work_rounded),
|
||||
hintText: 'Selecciona tu profesión',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, ingrese su nombre';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickCertificadoPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Cargar pdf del certificado'),
|
||||
_certificadoPdfFile != null
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
TextField(
|
||||
controller: _specialityController,
|
||||
onSubmitted: (value) {
|
||||
_addItemToList();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Especializaciones',
|
||||
prefixIcon: const Icon(Icons.assignment_rounded),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
_addItemToList();
|
||||
},
|
||||
icon: const Icon(Icons.add)),
|
||||
hintText: 'Ingresa tus especializaciones',
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickEspecializacionesPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'Cargar pdfs de tus especializaciones',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickCedulaPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Cargar pdf de la cedula'),
|
||||
_cedulaPdfFile != null
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
],
|
||||
),
|
||||
),
|
||||
_especializacionesPdfFiles?.isNotEmpty == true
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
const SizedBox(height: 20.0),
|
||||
TextFormField(
|
||||
controller: _professionController,
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
final professionName = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const ProfessionListScreen();
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (professionName != null) {
|
||||
_professionController.text = professionName;
|
||||
}
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Profesión',
|
||||
prefixIcon: Icon(Icons.work_rounded),
|
||||
hintText: 'Selecciona tu profesión',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, ingrese su nombre';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickCertificadoPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Cargar pdf del certificado'),
|
||||
_certificadoPdfFile != null
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
TextField(
|
||||
controller: _specialityController,
|
||||
onSubmitted: (value) {
|
||||
_addItemToList();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Especializaciones',
|
||||
prefixIcon: const Icon(Icons.assignment_rounded),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
_addItemToList();
|
||||
},
|
||||
icon: const Icon(Icons.add)),
|
||||
hintText: 'Ingresa tus especializaciones',
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
)),
|
||||
errorBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
),
|
||||
focusedErrorBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Colors.red, width: 2.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ElevatedButton(
|
||||
onPressed: _pickEspecializacionesPDF,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'Cargar pdfs de tus especializaciones',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
_especializacionesPdfFiles?.isNotEmpty == true
|
||||
? const Icon(Icons.check)
|
||||
: const Icon(Icons.file_upload_outlined),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
runSpacing: 4.0,
|
||||
children: _items
|
||||
.map((item) => Chip(
|
||||
label: Text(item),
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.tertiary,
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.blue),
|
||||
deleteIconColor: Colors.blue,
|
||||
onDeleted: () {
|
||||
_removeItemFromList(item);
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
color: Colors.blue, width: 0.3),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
runSpacing: 4.0,
|
||||
children: _items
|
||||
.map((item) => Chip(
|
||||
label: Text(item),
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.tertiary,
|
||||
labelStyle: const TextStyle(color: Colors.blue),
|
||||
deleteIconColor: Colors.blue,
|
||||
onDeleted: () {
|
||||
_removeItemFromList(item);
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
color: Colors.blue, width: 0.3),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
thickness: 0.5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 15,
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
ElevatedButton(
|
||||
child: FilledButton(
|
||||
onPressed: () {
|
||||
final userId =
|
||||
context.read<MyUserBloc>().state.user!.id;
|
||||
@@ -293,33 +315,26 @@ class _ProfessionalFormScreenState extends State<ProfessionalFormScreen> {
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blue,
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
shadowColor: Colors.grey,
|
||||
// elevation: 0,
|
||||
),
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 300.0, minHeight: 50.0),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
child: const Text(
|
||||
'Enviar a revisión',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user