Since scoped model has its own scope, it seems it breaks the usage of OpenContainer with the default provided code. It gets a cannot find scope error when this is there:
OpenContainer(
transitionType: ContainerTransitionType.fadeThrough,
closedBuilder:
(BuildContext _, VoidCallback openContainer) {
//_SelectedProductState.productName = "St. IvesĀ® Scrubs";
return Card();
},
openBuilder: (BuildContext _, VoidCallback __) {
return ScopedModel<DownloadImages>(
model: downloadImages,
child: WidgetHere(),
);
},
onClosed: (_) => print('Closed'),
),
Perhaps there should be a modification in the BuildContext
variables, but I have no idea what to do, maybe even a descendant. What should I do to fix it?
The transition and widget opening works, but during the animation the error occurs and the image in my Card
gets the red error.
Note: I have a ScopedModelDescendant
in this Card
widget, and the console shows that's where the error is, it seems it gets the wrong model when the animation occurs.