ソースを参照

Se arregló limite de obtencion de topings

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

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

@@ -760,7 +760,7 @@ class _PedidoFormState extends State<PedidoForm> {
                               mainAxisAlignment: MainAxisAlignment.center,
                               children: [
                                 Image.network(
-                                  topping.imagenes[0].media!.ruta!,
+                                  topping.mediaToping[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!.imagenes.isNotEmpty) {
-      for (int x = 0; x <= modelo.imagenes.length - 1; x++) {
+    if (modelo!.mediaToping.isNotEmpty) {
+      for (int x = 0; x <= modelo.mediaToping.length - 1; x++) {
         _registros.add(itemMedia(context, x));
       }
     }
@@ -262,7 +262,7 @@ class Formulario extends State<TopingForm> {
                   categoria: _selectedCategoriaId!,
                   costo: _costo.text,
                   activo: activo,
-                  imagenes: mediavm.archivos);
+                  fotos: 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!
-        .imagenes[index];
+        .mediaToping[index];
 
     // Asegúrate de que el objeto media no sea nulo
     if (mediaTC.media == null || mediaTC.media!.ruta!.isEmpty) {