Now, let's add a widget to display the image selected in the previous section, as follows:
- We will use a list of widgets, the image that was chosen from the gallery, and the prediction results, stacked or overlaid over each other to be displayed on the screen. Therefore, we begin by declaring an empty list of widgets that would contain all the children of the stack. Also, we declare a size instance to query the size of the window containing the application using the MediaQuery class, as follows:
List<Widget> stackChildren = [];Size size = MediaQuery.of(context).size;
- Now, the image is added as the first child of the stack, like this:
stackChildren.add(Positioned( top: 0.0, left: 0.0, width: ...