|
@@ -27,28 +27,28 @@ class _CategoriaProductoScreenState extends State<CategoriaProductoScreen> {
|
|
}
|
|
}
|
|
|
|
|
|
void go(CategoriaProducto categoriaProducto) {
|
|
void go(CategoriaProducto categoriaProducto) {
|
|
- showDialog(
|
|
|
|
- context: context,
|
|
|
|
- builder: (context) {
|
|
|
|
- return TotpCuadroConfirmacion(
|
|
|
|
- title: "Editar Categoría Producto",
|
|
|
|
- content:
|
|
|
|
- "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
- onSuccess: () {
|
|
|
|
- Navigator.push(
|
|
|
|
- context,
|
|
|
|
- MaterialPageRoute(
|
|
|
|
- builder: (context) =>
|
|
|
|
- CategoriaProductoForm(categoriaProducto: categoriaProducto),
|
|
|
|
- ),
|
|
|
|
- ).then((_) {
|
|
|
|
- Provider.of<CategoriaProductoViewModel>(context, listen: false)
|
|
|
|
- .fetchLocalAll();
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
|
|
+ // showDialog(
|
|
|
|
+ // context: context,
|
|
|
|
+ // builder: (context) {
|
|
|
|
+ // return TotpCuadroConfirmacion(
|
|
|
|
+ // title: "Editar Categoría Producto",
|
|
|
|
+ // content:
|
|
|
|
+ // "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
+ // onSuccess: () {
|
|
|
|
+ // Navigator.push(
|
|
|
|
+ // context,
|
|
|
|
+ // MaterialPageRoute(
|
|
|
|
+ // builder: (context) =>
|
|
|
|
+ // CategoriaProductoForm(categoriaProducto: categoriaProducto),
|
|
|
|
+ // ),
|
|
|
|
+ // ).then((_) {
|
|
|
|
+ // Provider.of<CategoriaProductoViewModel>(context, listen: false)
|
|
|
|
+ // .fetchLocalAll();
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
}
|
|
}
|
|
|
|
|
|
void clearSearchAndReset() {
|
|
void clearSearchAndReset() {
|
|
@@ -114,36 +114,36 @@ class _CategoriaProductoScreenState extends State<CategoriaProductoScreen> {
|
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
|
PopupMenuButton(
|
|
PopupMenuButton(
|
|
itemBuilder: (context) => [
|
|
itemBuilder: (context) => [
|
|
- PopupMenuItem(
|
|
|
|
- child: const Text('Editar'),
|
|
|
|
- onTap: () => go(item),
|
|
|
|
- ),
|
|
|
|
- PopupMenuItem(
|
|
|
|
- child: const Text('Eliminar'),
|
|
|
|
- onTap: () async {
|
|
|
|
- Future.delayed(Duration.zero, () {
|
|
|
|
- showDialog(
|
|
|
|
- context: context,
|
|
|
|
- builder: (context) {
|
|
|
|
- return TotpCuadroConfirmacion(
|
|
|
|
- title: "Eliminar Categoría Producto",
|
|
|
|
- content:
|
|
|
|
- "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
- onSuccess: () async {
|
|
|
|
- await Provider.of<CategoriaProductoViewModel>(
|
|
|
|
- context,
|
|
|
|
- listen: false)
|
|
|
|
- .deleteCategoriaProducto(item.id);
|
|
|
|
- Provider.of<CategoriaProductoViewModel>(context,
|
|
|
|
- listen: false)
|
|
|
|
- .fetchLocalAll();
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
|
|
+ // PopupMenuItem(
|
|
|
|
+ // child: const Text('Editar'),
|
|
|
|
+ // onTap: () => go(item),
|
|
|
|
+ // ),
|
|
|
|
+ // PopupMenuItem(
|
|
|
|
+ // child: const Text('Eliminar'),
|
|
|
|
+ // onTap: () async {
|
|
|
|
+ // Future.delayed(Duration.zero, () {
|
|
|
|
+ // showDialog(
|
|
|
|
+ // context: context,
|
|
|
|
+ // builder: (context) {
|
|
|
|
+ // return TotpCuadroConfirmacion(
|
|
|
|
+ // title: "Eliminar Categoría Producto",
|
|
|
|
+ // content:
|
|
|
|
+ // "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
+ // onSuccess: () async {
|
|
|
|
+ // await Provider.of<CategoriaProductoViewModel>(
|
|
|
|
+ // context,
|
|
|
|
+ // listen: false)
|
|
|
|
+ // .deleteCategoriaProducto(item.id);
|
|
|
|
+ // Provider.of<CategoriaProductoViewModel>(context,
|
|
|
|
+ // listen: false)
|
|
|
|
+ // .fetchLocalAll();
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
+ // ),
|
|
],
|
|
],
|
|
icon: const Icon(Icons.more_vert),
|
|
icon: const Icon(Icons.more_vert),
|
|
),
|
|
),
|
|
@@ -348,42 +348,42 @@ class _CategoriaProductoScreenState extends State<CategoriaProductoScreen> {
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
- floatingActionButton: FloatingActionButton.extended(
|
|
|
|
- onPressed: () async {
|
|
|
|
- showDialog(
|
|
|
|
- context: context,
|
|
|
|
- builder: (context) {
|
|
|
|
- return TotpCuadroConfirmacion(
|
|
|
|
- title: "Agregar Categoría",
|
|
|
|
- content:
|
|
|
|
- "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
- onSuccess: () {
|
|
|
|
- CategoriaProducto nuevoProducto = CategoriaProducto();
|
|
|
|
- Navigator.push(
|
|
|
|
- context,
|
|
|
|
- MaterialPageRoute(
|
|
|
|
- builder: (context) => CategoriaProductoForm(
|
|
|
|
- categoriaProducto: nuevoProducto),
|
|
|
|
- ),
|
|
|
|
- ).then((_) => Provider.of<CategoriaProductoViewModel>(context,
|
|
|
|
- listen: false)
|
|
|
|
- .fetchLocalAll());
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- icon: Icon(Icons.add, size: 30, color: AppTheme.quaternary),
|
|
|
|
- label: Text(
|
|
|
|
- "Agregar Categoria Producto",
|
|
|
|
- style: TextStyle(fontSize: 18, color: AppTheme.quaternary),
|
|
|
|
- ),
|
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
|
- borderRadius: BorderRadius.circular(8),
|
|
|
|
- ),
|
|
|
|
- materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
- backgroundColor: AppTheme.tertiary,
|
|
|
|
- ),
|
|
|
|
|
|
+ // floatingActionButton: FloatingActionButton.extended(
|
|
|
|
+ // onPressed: () async {
|
|
|
|
+ // showDialog(
|
|
|
|
+ // context: context,
|
|
|
|
+ // builder: (context) {
|
|
|
|
+ // return TotpCuadroConfirmacion(
|
|
|
|
+ // title: "Agregar Categoría",
|
|
|
|
+ // content:
|
|
|
|
+ // "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
+ // onSuccess: () {
|
|
|
|
+ // CategoriaProducto nuevoProducto = CategoriaProducto();
|
|
|
|
+ // Navigator.push(
|
|
|
|
+ // context,
|
|
|
|
+ // MaterialPageRoute(
|
|
|
|
+ // builder: (context) => CategoriaProductoForm(
|
|
|
|
+ // categoriaProducto: nuevoProducto),
|
|
|
|
+ // ),
|
|
|
|
+ // ).then((_) => Provider.of<CategoriaProductoViewModel>(context,
|
|
|
|
+ // listen: false)
|
|
|
|
+ // .fetchLocalAll());
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
|
|
+ // },
|
|
|
|
+ // );
|
|
|
|
+ // },
|
|
|
|
+ // icon: Icon(Icons.add, size: 30, color: AppTheme.quaternary),
|
|
|
|
+ // label: Text(
|
|
|
|
+ // "Agregar Categoria Producto",
|
|
|
|
+ // style: TextStyle(fontSize: 18, color: AppTheme.quaternary),
|
|
|
|
+ // ),
|
|
|
|
+ // shape: RoundedRectangleBorder(
|
|
|
|
+ // borderRadius: BorderRadius.circular(8),
|
|
|
|
+ // ),
|
|
|
|
+ // materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
+ // backgroundColor: AppTheme.tertiary,
|
|
|
|
+ // ),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|