ソースを参照

Se arregló el limite en la obtencion de topings

OscarGil03 1 年間 前
コミット
5fd9286b68
共有2 個のファイルを変更した7 個の追加7 個の削除を含む
  1. 3 3
      lib/views/pedido/pedido_form.dart
  2. 4 4
      lib/views/toping/toping_form.dart

+ 3 - 3
lib/views/pedido/pedido_form.dart

@@ -92,7 +92,7 @@ class _PedidoFormState extends State<PedidoForm> {
 
 // Función para cargar topings disponibles
   void _cargarTopingsDisponibles() async {
-    _topingsDisponibles = await _topingViewModel.fetchRegistros();
+    _topingsDisponibles = await _topingViewModel.fetchRegistros(limitee: -1);
 
     var categorias = await _categoriaTopingViewModel.fetchRegistros();
     var categoriaBase = categorias.firstWhereOrNull(
@@ -185,7 +185,7 @@ class _PedidoFormState extends State<PedidoForm> {
         .setBusqueda(_busqueda.text);
     var productosResultantes =
         await Provider.of<ProductoViewModel>(context, listen: false)
-            .fetchRegistros();
+            .fetchRegistros(limitee: -1);
     await Provider.of<ProductoViewModel>(context, listen: false)
         .setBusqueda("");
     await Provider.of<ProductoViewModel>(context, listen: false)
@@ -760,7 +760,7 @@ class _PedidoFormState extends State<PedidoForm> {
                               mainAxisAlignment: MainAxisAlignment.center,
                               children: [
                                 Image.network(
-                                  topping.mediaToping[0].media!.ruta!,
+                                  topping.imagenes[0].media!.ruta!,
                                   width: 80,
                                   loadingBuilder: (BuildContext context,
                                       Widget child,

+ 4 - 4
lib/views/toping/toping_form.dart

@@ -85,8 +85,8 @@ class Formulario extends State<TopingForm> {
     final Toping = mvm.selectedToping;
 
     List<Widget> _registros = [];
-    if (modelo!.mediaToping.isNotEmpty) {
-      for (int x = 0; x <= modelo.mediaToping.length - 1; x++) {
+    if (modelo!.imagenes.isNotEmpty) {
+      for (int x = 0; x <= modelo.imagenes.length - 1; x++) {
         _registros.add(itemMedia(context, x));
       }
     }
@@ -262,7 +262,7 @@ class Formulario extends State<TopingForm> {
                   categoria: _selectedCategoriaId!,
                   costo: _costo.text,
                   activo: activo,
-                  fotos: mediavm.archivos);
+                  imagenes: mediavm.archivos);
               Provider.of<TopingViewModel>(context, listen: false)
                   .setIsLoading(false);
               if (context.mounted) {
@@ -278,7 +278,7 @@ class Formulario extends State<TopingForm> {
   Widget itemMedia(BuildContext context, int index) {
     MediaToping mediaTC = Provider.of<TopingViewModel>(context, listen: false)
         .selectedToping!
-        .mediaToping[index];
+        .imagenes[index];
 
     // Asegúrate de que el objeto media no sea nulo
     if (mediaTC.media == null || mediaTC.media!.ruta!.isEmpty) {