|
@@ -73,10 +73,14 @@ class _CategoriaProductoScreenState extends State<CategoriaProductoScreen> {
|
|
final productoViewModel =
|
|
final productoViewModel =
|
|
Provider.of<ProductoViewModel>(context, listen: false);
|
|
Provider.of<ProductoViewModel>(context, listen: false);
|
|
|
|
|
|
|
|
+ final categoriaViewModel =
|
|
|
|
+ Provider.of<CategoriaProductoViewModel>(context, listen: false);
|
|
|
|
+
|
|
try {
|
|
try {
|
|
await productoViewModel.sincronizarProductosYCategorias();
|
|
await productoViewModel.sincronizarProductosYCategorias();
|
|
_mostrarResultado(
|
|
_mostrarResultado(
|
|
context, 'La sincronización se completó exitosamente.', true);
|
|
context, 'La sincronización se completó exitosamente.', true);
|
|
|
|
+ await categoriaViewModel.fetchLocalAll();
|
|
} catch (e) {
|
|
} catch (e) {
|
|
_mostrarResultado(context, e.toString(), false);
|
|
_mostrarResultado(context, e.toString(), false);
|
|
}
|
|
}
|