Commit b08ae14f authored by Ester Alfonzo's avatar Ester Alfonzo

nuevas funcionalidades

parent b5598dab
favicon.png,1679924901810,85143c1f138d3c120e66e75d32dc16cee244f4ad49c05cceb692f489dcb9cf8f
404.html,1679924812520,b7bab6b83fa074653ff28c8d2a64135d3434575f70a12ab3d3ba8080461b9537
index.html,1679924901810,b18d11fbea6ef27e475558d562cb4b631938864857db08ba128b18c522ebbd8f
flutter_service_worker.js,1679924902326,358de7936cf091d555214591456ecf5eb5210cebc880b92b5992699ec1c621f9
version.json,1679924901518,5f5b75bfabb6574ab1710e8d4ac87b98b7e824ef2f722fe814c496217b9a54dc
manifest.json,1679924901638,50d775d035db6ab0f84548ea5ec03f35ec020f4654c1ffa254b75be55fede1a9
assets/AssetManifest.json,1679924901630,a12757f84f925a136d3db02dc2af2a3aef6a88025ad2f02887cdc9a1f6366d6f
assets/FontManifest.json,1679924901630,2e577238aa37b66dce45953302454e5cb5815118874d0936475541ee4bc549d1
assets/packages/fluttertoast/assets/toastify.css,1679924901610,b3106479402ae9cdfaebc5e46d5b8f807692c6fff685bd43b29ef265fe1f59de
flutter.js,1679920646518,97ed2f98cb0c00158de183673e81b516e92e0b04e5b2a9b34b5c424627e8aa48
assets/packages/fluttertoast/assets/toastify.js,1679924901614,af7cc93040f6a408fc5081768148326a2d6fa411d38e24c6adfa5dc067f8a1cd
splash/splash.js,1679924901806,390064bc34b70131c9ef52749b48d1ad5eb8da5b330755aa9edf11b2f7a03704
splash/style.css,1679924901806,6bc1f1e841486df72b800736fc3f81ac053b78c4ebfa2ad8ee1f0643878dcb30
splash/img/dark-1x.png,1679924901638,70521923b12d65e1779e7375055c4db663cdfad4814f99c9945113eb85e15571
splash/img/light-1x.png,1679924901802,70521923b12d65e1779e7375055c4db663cdfad4814f99c9945113eb85e15571
assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf,1679924901614,0e556debdc639be357c09908bc9f3681127aba88ad920a794e178d39da0bf252
splash/img/dark-2x.png,1679924901802,c23fdeab107570d9c46f8196832fc91dc438ddab44d1d58960bd5c7aa14c8c33
splash/img/light-2x.png,1679924901638,c23fdeab107570d9c46f8196832fc91dc438ddab44d1d58960bd5c7aa14c8c33
icons/Icon-192.png,1679924901634,0cc2c871b8552f8d243c25baa8226fd98a0db8815f6456774f7b11cf7793fc09
icons/Icon-maskable-192.png,1679924901634,0cc2c871b8552f8d243c25baa8226fd98a0db8815f6456774f7b11cf7793fc09
splash/img/dark-3x.png,1679924901638,f2fe240cc6f4fc0ac96e79495e1599dbbf3d9e7520010ef13b02171a67aa513b
assets/assets/UNA_logo.png,1679924901610,68984bbfbb32ed151488d40c79ec350a6dfc54e57babe9eb6c3836c98c4fd22f
splash/img/light-3x.png,1679924901638,f2fe240cc6f4fc0ac96e79495e1599dbbf3d9e7520010ef13b02171a67aa513b
canvaskit/canvaskit.js,1679920646334,862fbc90b0cdab302519d536322dddbcf3c9d519db25260ff9c3d04932747002
splash/img/dark-4x.png,1679924901638,e0de666a05e47e77e1e3927006d5989e0a42e5515afaf3e5d159e2b6b5c1a5cf
splash/img/light-4x.png,1679924901802,e0de666a05e47e77e1e3927006d5989e0a42e5515afaf3e5d159e2b6b5c1a5cf
canvaskit/profiling/canvaskit.js,1679920646518,5e094643fdde460eef4aefb7fac175854a74ba1ecb1c8652c24145d23122b58f
assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf,1679924901614,caf68fabc3db88132f4f4126f25681286fa2924ff1349ccaf2a3748c5f7eb571
icons/Icon-512.png,1679924901634,9fce85e33f4e44d68cf6ca51b23e0b012be871350cb9e4c339ffcd4aef700ea5
icons/Icon-maskable-512.png,1679924901634,9fce85e33f4e44d68cf6ca51b23e0b012be871350cb9e4c339ffcd4aef700ea5
assets/NOTICES,1679924901630,2156299f48e62b6df2b80be103686ab1d8c106ea1794ea9a921e1f6421e1c482
assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf,1679924901614,11b3a031a495d8a9f099ff65c5488ad17e2897e1bbc7c18a396d8a624ea3f626
assets/fonts/MaterialIcons-Regular.otf,1679924901614,01e1893e23bcf2e77aa3229c67ae0f47bca9354102373c6363dea40d78fb848c
main.dart.js,1679924901514,5942cf160610d39e0e85e467a073ad7795961c403ae6182b2a6bb2f2bd867c5d
canvaskit/canvaskit.wasm,1679920646150,c113b3200832c9cd19033de4cc79770e0bbc8cbd3d09df1a3dec9a513eda0577
canvaskit/profiling/canvaskit.wasm,1679920646442,4102b5e3159b137ccc8d739bce1796d9dc795c604e400ae060f30207a01ebe9a
flutter.js,1680012197873,97ed2f98cb0c00158de183673e81b516e92e0b04e5b2a9b34b5c424627e8aa48
canvaskit/canvaskit.js,1680012197537,862fbc90b0cdab302519d536322dddbcf3c9d519db25260ff9c3d04932747002
canvaskit/canvaskit.wasm,1680012197341,c113b3200832c9cd19033de4cc79770e0bbc8cbd3d09df1a3dec9a513eda0577
canvaskit/profiling/canvaskit.js,1680012197709,5e094643fdde460eef4aefb7fac175854a74ba1ecb1c8652c24145d23122b58f
canvaskit/profiling/canvaskit.wasm,1680012197549,4102b5e3159b137ccc8d739bce1796d9dc795c604e400ae060f30207a01ebe9a
favicon.png,1680016094068,85143c1f138d3c120e66e75d32dc16cee244f4ad49c05cceb692f489dcb9cf8f
manifest.json,1680016094060,50d775d035db6ab0f84548ea5ec03f35ec020f4654c1ffa254b75be55fede1a9
index.html,1680016094068,f10de1f3049235aba4cb460d5ab83879971a6a8d52f1480a7fdc19e1b448cde9
version.json,1680016093960,5f5b75bfabb6574ab1710e8d4ac87b98b7e824ef2f722fe814c496217b9a54dc
assets/AssetManifest.json,1680016094056,b80daad7c243bd3162041484d3509faa4474f1bbb45d8bdb142c73daa6e1e1ee
assets/FontManifest.json,1680016094056,2e577238aa37b66dce45953302454e5cb5815118874d0936475541ee4bc549d1
flutter_service_worker.js,1680016094500,c7179c8966a69c8a82c3b65c753b120a287065d743894a8bbe39b4e0b74245f2
assets/packages/fluttertoast/assets/toastify.css,1680016094052,b3106479402ae9cdfaebc5e46d5b8f807692c6fff685bd43b29ef265fe1f59de
assets/assets/pdf.png,1680016094052,1896db7c09b8d87cfa800a6f54bcefc378ead10f157a718811d8dbc6f39358ab
assets/packages/fluttertoast/assets/toastify.js,1680016094052,af7cc93040f6a408fc5081768148326a2d6fa411d38e24c6adfa5dc067f8a1cd
splash/splash.js,1680016094064,390064bc34b70131c9ef52749b48d1ad5eb8da5b330755aa9edf11b2f7a03704
splash/style.css,1680016094064,6bc1f1e841486df72b800736fc3f81ac053b78c4ebfa2ad8ee1f0643878dcb30
splash/img/dark-1x.png,1680016094060,70521923b12d65e1779e7375055c4db663cdfad4814f99c9945113eb85e15571
splash/img/light-1x.png,1680016094064,70521923b12d65e1779e7375055c4db663cdfad4814f99c9945113eb85e15571
assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf,1680016094052,0e556debdc639be357c09908bc9f3681127aba88ad920a794e178d39da0bf252
splash/img/dark-2x.png,1680016094060,c23fdeab107570d9c46f8196832fc91dc438ddab44d1d58960bd5c7aa14c8c33
splash/img/light-2x.png,1680016094060,c23fdeab107570d9c46f8196832fc91dc438ddab44d1d58960bd5c7aa14c8c33
icons/Icon-192.png,1680016094060,0cc2c871b8552f8d243c25baa8226fd98a0db8815f6456774f7b11cf7793fc09
icons/Icon-maskable-192.png,1680016094060,0cc2c871b8552f8d243c25baa8226fd98a0db8815f6456774f7b11cf7793fc09
splash/img/dark-3x.png,1680016094060,f2fe240cc6f4fc0ac96e79495e1599dbbf3d9e7520010ef13b02171a67aa513b
splash/img/light-3x.png,1680016094060,f2fe240cc6f4fc0ac96e79495e1599dbbf3d9e7520010ef13b02171a67aa513b
assets/assets/UNA_logo.png,1680016094052,68984bbfbb32ed151488d40c79ec350a6dfc54e57babe9eb6c3836c98c4fd22f
splash/img/dark-4x.png,1680016094060,e0de666a05e47e77e1e3927006d5989e0a42e5515afaf3e5d159e2b6b5c1a5cf
splash/img/light-4x.png,1680016094064,e0de666a05e47e77e1e3927006d5989e0a42e5515afaf3e5d159e2b6b5c1a5cf
assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf,1680016094052,caf68fabc3db88132f4f4126f25681286fa2924ff1349ccaf2a3748c5f7eb571
icons/Icon-maskable-512.png,1680016094060,9fce85e33f4e44d68cf6ca51b23e0b012be871350cb9e4c339ffcd4aef700ea5
icons/Icon-512.png,1680016094060,9fce85e33f4e44d68cf6ca51b23e0b012be871350cb9e4c339ffcd4aef700ea5
assets/NOTICES,1680016094056,2a45dff10b3d78315f3b43b534509461320a902d9dda6676d589e19ecb7a6a13
assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf,1680016094052,11b3a031a495d8a9f099ff65c5488ad17e2897e1bbc7c18a396d8a624ea3f626
assets/fonts/MaterialIcons-Regular.otf,1680016094056,01e1893e23bcf2e77aa3229c67ae0f47bca9354102373c6363dea40d78fb848c
main.dart.js,1680016093956,8a842e77ac3bd464e03fcc40c9bbaae15abd16b5e6b6ad958400f8191c75c37d
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
class CustomAnimatedBottomBar extends StatelessWidget {
CustomAnimatedBottomBar({
......@@ -52,6 +54,7 @@ class CustomAnimatedBottomBar extends StatelessWidget {
child: Row(
mainAxisAlignment: mainAxisAlignment,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: items.map((item) {
var index = items.indexOf(item);
return Expanded(
......
......@@ -10,43 +10,81 @@ import '../services/authService.dart';
Widget AppBarCommon(BuildContext context, action2) {
return Container(
height: 25.h,
width: kIsWeb ? 70.w : 100.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(50),
bottomRight: Radius.circular(50),
),
color: Theme.of(context).colorScheme.primary,
),
child: AppBar(
elevation: 0,
leading: Image.asset(
'assets/UNA_logo.png',
scale: 1,
height: 12.h,
width: 15.w,
child: Column(children: [
AppBar(
elevation: 0,
leading: Image.asset(
'assets/UNA_logo.png',
scale: 1,
height: 12.h,
width: 15.w,
),
title: Text(
'CENMU',
style: TextStyle(
fontSize: kIsWeb ? 10.sp : 16.sp, fontWeight: FontWeight.bold),
),
centerTitle: kIsWeb ? false : true,
actions: [
kIsWeb
? GestureDetector(
onTap: () {
logout(context);
},
child: Container(
padding: EdgeInsets.all(3),
margin: EdgeInsets.all(3),
height: 4.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(50)),
color: Theme.of(context).colorScheme.secondary,
),
child: Row(
children: [
/*Text(
"Cerrar Sesión",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 5.sp,
),
),
SizedBox(
width: 1.w,
),*/
Icon(
FontAwesomeIcons.rightFromBracket,
size: 2.8.h,
),
],
),
),
)
: const SizedBox.shrink(),
action2
],
),
SizedBox(
height: 5.h,
),
title: Text(
'CENMU',
Text(
"Comisión de Estudio de Nuevo Modelo de Universidad",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: kIsWeb ? 13.sp : 16.sp, fontWeight: FontWeight.bold),
fontSize: kIsWeb ? 8.sp : 12.sp,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
color: Colors.white,
),
),
centerTitle: kIsWeb ? false : true,
actions: [
kIsWeb
? IconButton(
icon: const Icon(
FontAwesomeIcons.rightFromBracket,
size: 23,
),
onPressed: () {
logout(context);
},
)
: const SizedBox.shrink(),
action2
],
),
]),
);
}
......@@ -266,7 +304,7 @@ Widget commonText(BuildContext context, String text) {
text,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 10.sp,
fontSize: kIsWeb ? 6.sp : 10.sp,
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.w500,
),
......
import 'package:CENMU/services/fileDownloadService.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
......@@ -48,9 +49,8 @@ class _ActividadesPrevistasScreenState
Widget build(BuildContext context) {
//print('build ActividadesRecientesCREEN');
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15), topRight: Radius.circular(15))),
child: ListView.builder(
......@@ -67,39 +67,43 @@ class _ActividadesPrevistasScreenState
child: Text(
listA[index].first["fecha"].toString(),
style: TextStyle(
fontSize: 16.sp,
fontSize: kIsWeb ? 8.sp : 16.sp,
fontWeight: FontWeight.bold,
),
),
),
Flexible(
child: ListView.separated(
child: ListView.builder(
shrinkWrap: true,
separatorBuilder: (context, int y) =>
Divider(color: Colors.black.withOpacity(0.5)),
itemCount: listA[index].length,
itemBuilder: (BuildContext context, i) => ListTile(
leading: Image.asset(
'assets/pdf.png',
scale: 1,
height: 8.h,
height: kIsWeb ? 6.h : 4.h,
),
title: Text(
listA[index][i]["titulo"],
style: TextStyle(
fontSize: 15.sp,
fontSize: kIsWeb ? 7.sp : 15.sp,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.secondary,
),
),
subtitle: Text(listA[index][i]["descripcion"]),
subtitle: Text(
listA[index][i]["descripcion"],
style: TextStyle(
fontSize: kIsWeb ? 5.sp : 15.sp,
fontWeight: FontWeight.bold,
),
),
trailing: GestureDetector(
onTap: () =>
downloadPdfPrevista(context, listA[index][i]),
child: Icon(
Icons.download,
color: Theme.of(context).colorScheme.primary,
size: 4.h,
size: kIsWeb ? 6.w : 4.h,
),
),
),
......
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
......@@ -48,9 +49,8 @@ class _ActividadesRecientesScreenState
Widget build(BuildContext context) {
//print('build ActividadesRecientesCREEN');
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15), topRight: Radius.circular(15))),
child: ListView.builder(
......@@ -67,39 +67,43 @@ class _ActividadesRecientesScreenState
child: Text(
listA[index].first["fecha"].toString(),
style: TextStyle(
fontSize: 16.sp,
fontSize: kIsWeb ? 8.sp : 16.sp,
fontWeight: FontWeight.bold,
),
),
),
Flexible(
child: ListView.separated(
child: ListView.builder(
shrinkWrap: true,
separatorBuilder: (context, int y) =>
Divider(color: Colors.black.withOpacity(0.5)),
itemCount: listA[index].length,
itemBuilder: (BuildContext context, i) => ListTile(
leading: Image.asset(
'assets/pdf.png',
scale: 1,
height: 8.h,
height: kIsWeb ? 6.h : 4.h,
),
title: Text(
listA[index][i]["titulo"],
style: TextStyle(
fontSize: 15.sp,
fontSize: kIsWeb ? 7.sp : 15.sp,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.secondary,
),
),
subtitle: Text(listA[index][i]["descripcion"]),
subtitle: Text(
listA[index][i]["descripcion"],
style: TextStyle(
fontSize: kIsWeb ? 5.sp : 15.sp,
fontWeight: FontWeight.bold,
),
),
trailing: GestureDetector(
onTap: () =>
downloadPdfReciente(context, listA[index][i]),
downloadPdfPrevista(context, listA[index][i]),
child: Icon(
Icons.download,
color: Theme.of(context).colorScheme.primary,
size: 4.h,
size: kIsWeb ? 6.h : 4.h,
),
),
),
......
......@@ -3,6 +3,7 @@ import 'package:CENMU/screens/ActividadesRecientesScreen.dart';
import 'package:CENMU/screens/NuevaActividadScreen.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
import '../common_widgets/CustomBottonBar.dart';
import '../common_widgets/Widgets.dart';
......@@ -35,9 +36,7 @@ class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
//print('build HomeCREEN');
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: Column(
children: <Widget>[
AppBarCommon(context, const SizedBox.shrink()),
......@@ -107,7 +106,7 @@ class _HomeScreenState extends State<HomeScreen> {
]
: [
BottomNavyBarItem(
icon: const Icon(Icons.savings_outlined),
icon: const Icon(Icons.file_present),
title: const Text(
'Actividades Previstas',
style: TextStyle(fontSize: 14),
......
import 'dart:io';
import 'package:CENMU/services/loadingService.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:file_picker/file_picker.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:sizer/sizer.dart';
import '../common_styles.dart';
import '../common_widgets/Widgets.dart';
import '../services/toastService.dart';
class NuevaActividadScreen extends StatefulWidget {
const NuevaActividadScreen({Key? key}) : super(key: key);
......@@ -14,7 +19,6 @@ class NuevaActividadScreen extends StatefulWidget {
}
class _NuevaActividadScreenState extends State<NuevaActividadScreen> {
final GlobalKey<FormState> _form = GlobalKey<FormState>();
final TextEditingController descripcionController = TextEditingController();
final TextEditingController tituloController = TextEditingController();
final TextEditingController fechaController = TextEditingController();
......@@ -40,128 +44,126 @@ class _NuevaActividadScreenState extends State<NuevaActividadScreen> {
if (result != null) {
setState(() {
documents.add({
'nombre': result.files.single.name,
'posicion': result.files.single.path
'nombre': result.files.first.name,
'position': result.files.first.bytes
});
});
print(documents);
File file = File(result.files.single.path.toString());
//print(documents);
//File file = File(result.files.single.path.toString());
} else {
// User canceled the picker
}
}
guardarTodo(Map<String, dynamic> json) async {
List<dynamic> l = [];
for (int i = 0; i < documents.length; i++) {
json['url'] = documents[i]['nombre'];
json['time'] = DateTime.now().microsecondsSinceEpoch;
if (dropdownvalueActi == 'PREVISTA') {
await FirebaseStorage.instance
.ref('previstas/${documents[i]['nombre']}')
.putData(documents[i]['position']);
} else {
await FirebaseStorage.instance
.ref('recientes/${documents[i]['nombre']}')
.putData(documents[i]['position']);
}
l.add(json);
}
final bd = FirebaseFirestore.instance;
var acti;
if (dropdownvalueActi == 'PREVISTA') {
acti = bd.collection("actividades_previstas");
} else {
acti = bd.collection("actividades_recientes");
}
acti
.doc(DateTime.now().microsecondsSinceEpoch.toString())
.set({"lista": l});
await dismissPresent();
}
@override
Widget build(BuildContext context) {
//print('build NuevaActividadCREEN');
return Scaffold(
body: Container(
margin: EdgeInsets.all(15),
child: Form(
key: _form,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: ListView(children: <Widget>[
Center(
margin: const EdgeInsets.all(15),
child: ListView(children: <Widget>[
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.95,
margin: const EdgeInsets.only(bottom: 15),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(5.0),
),
child: Container(
width: MediaQuery.of(context).size.width * 0.95,
margin: const EdgeInsets.only(bottom: 15),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(5.0),
),
child: Container(
padding: const EdgeInsets.only(
top: 10.0, bottom: 5.0, left: 15.0, right: 15.0),
child: Column(
children: <Widget>[
commonText(context, 'Titulo*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: tituloController,
keyboardType: TextInputType.text,
decoration:
inputDecorationCrearTramiteStyle('Titulo*', true),
),
commonText(context, 'Descripcion*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: descripcionController,
keyboardType: TextInputType.emailAddress,
decoration:
inputDecorationCrearTramiteStyle('Nombre*', true),
),
commonText(context, 'Fecha*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: fechaController,
keyboardType: TextInputType.emailAddress,
decoration:
inputDecorationCrearTramiteStyle('Fecha*', true),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: commonText(context, 'Publicar*'),
),
Flexible(
child: DropdownButton<String>(
// Initial Value
value: dropdownvaluePublicar,
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: ["SI", "NO"].map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
dropdownvaluePublicar = newValue!;
});
},
),
),
]),
Row(
padding: const EdgeInsets.only(
top: 10.0, bottom: 5.0, left: 15.0, right: 15.0),
child: Column(
children: <Widget>[
commonText(context, 'Titulo*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: tituloController,
keyboardType: TextInputType.text,
decoration:
inputDecorationCrearTramiteStyle('Titulo*', true),
),
commonText(context, 'Descripcion*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: descripcionController,
keyboardType: TextInputType.emailAddress,
decoration:
inputDecorationCrearTramiteStyle('Nombre*', true),
),
commonText(context, 'Fecha*'),
TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'Requerido';
}
return null;
},
controller: fechaController,
keyboardType: TextInputType.emailAddress,
decoration:
inputDecorationCrearTramiteStyle('Fecha*', true),
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: commonText(context, 'Tipo de Actividad*'),
child: commonText(context, 'Publicar*'),
),
Flexible(
child: DropdownButton<String>(
// Initial Value
value: dropdownvalueActi,
value: dropdownvaluePublicar,
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items:
["RECIENTE", "PREVISTA"].map((String items) {
items: ["SI", "NO"].map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
......@@ -170,49 +172,92 @@ class _NuevaActividadScreenState extends State<NuevaActividadScreen> {
onChanged: (String? newValue) {
setState(() {
dropdownvalueActi = newValue!;
dropdownvaluePublicar = newValue!;
});
},
),
),
],
),
]),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: commonText(context, 'Tipo de Actividad*'),
),
Flexible(
child: DropdownButton<String>(
// Initial Value
value: dropdownvalueActi,
///////////////////
///Archivos
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: commonText(context, 'Archivos*'),
),
Flexible(
child: Container(
alignment: Alignment.topLeft,
child: ElevatedButton(
onPressed: () => elegirArchivo(),
style: ElevatedButton.styleFrom(
minimumSize: Size.zero, // Set this
),
child: Text(
'ADJUNTAR',
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.bold),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: ["RECIENTE", "PREVISTA"].map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
dropdownvalueActi = newValue!;
});
},
),
),
],
),
///////////////////
///Archivos
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: commonText(context, 'Archivos*'),
),
Flexible(
child: Container(
alignment: Alignment.topLeft,
child: ElevatedButton(
onPressed: () => elegirArchivo(),
style: ElevatedButton.styleFrom(
minimumSize: Size.zero, // Set this
),
child: Text(
'ADJUNTAR',
style: TextStyle(
fontSize: kIsWeb ? 8.sp : 10.sp,
fontWeight: FontWeight.bold,
),
),
),
),
]),
if (documents.isNotEmpty) ...[
Swiper(
),
]),
if (documents.isNotEmpty) ...[
Container(
padding: const EdgeInsets.only(top: 15, bottom: 15),
margin: const EdgeInsets.only(top: 15, bottom: 15),
height: 35.h,
width: 100.w,
child: Swiper(
pagination: const SwiperPagination(),
scrollDirection: Axis.horizontal,
itemCount: documents.length,
layout: SwiperLayout.DEFAULT,
itemHeight: MediaQuery.of(context).size.height * 0.30,
itemWidth: MediaQuery.of(context).size.width * 0.98,
itemHeight: 25.h,
itemWidth: 98.w,
itemBuilder: (BuildContext context, int indexSwip) {
return Container(
alignment: Alignment.center,
......@@ -223,36 +268,82 @@ class _NuevaActividadScreenState extends State<NuevaActividadScreen> {
color: Theme.of(context)
.colorScheme
.secondary
.withOpacity(0.5),
.withOpacity(0.2),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Text(
documents[indexSwip]['titulo'],
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context)
.colorScheme
.primary,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/pdf.png',
scale: 1,
height: 10.h,
width: 10.w,
),
Center(
child: Text(
documents[indexSwip]['nombre'],
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 10.sp,
color: Theme.of(context)
.colorScheme
.primary,
),
),
),
),
],
),
]),
);
},
),
]
/////////////////////////////////////////////////
),
],
),
/////////////////////////////////////////////////
const SizedBox(
height: 15,
),
ElevatedButton(
child: Text(
'GUARDAR',
style: TextStyle(
fontSize: kIsWeb ? 8.sp : 10.sp,
fontWeight: FontWeight.bold,
),
),
style: ElevatedButton.styleFrom(
padding: EdgeInsets.all(8),
minimumSize: Size.zero, // Set this
),
onPressed: () async {
if (tituloController.text != '' &&
descripcionController.text != '' &&
fechaController.text != '') {
await showPresent("Guardando...");
var json = {
'titulo': tituloController.text,
'descripcion': descripcionController.text,
'publicar':
dropdownvaluePublicar == 'SI' ? true : false,
'fecha': fechaController.text,
'url': "",
"time": "",
"archivo": "PDF"
};
guardarTodo(json);
} else {
showToastError('Complete todos los campos');
}
},
),
const SizedBox(
height: 10,
),
],
),
),
),
]),
),
),
]),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment