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