0

As per image I want to push the data into a new widget...

enter image description here

In the second widget I have creator a constructor:

final Unint8List image create the new container Container(child: Image.Memory(widget.image)

eerything is fine but from the first container I need to push the Image into the second container.... using:

Navigator.push...... SecondWidget(image: image) it doesnt work, which kind of Navigator I need to use??

Tizi Dev
  • 301
  • 6
  • 19
  • 1
    Please see that [answer](https://stackoverflow.com/questions/53861302/passing-data-between-screens-in-flutter). There its explained in detail. – Dany Tulumidis Jun 17 '21 at 13:21
  • 3
    `navigator` is used for redirecting to some other page. in your pic it looks same page so use `setState()` and just set the variable to you like – Pokaboom Jun 17 '21 at 14:11
  • 1
    you do not need to navigate or pass the data, it looks like you are in the same page, so you can use setState but be sure to use a stateful widget and in this way. – Mohammad Rabiee Nasri Jun 17 '21 at 19:15
  • I am trying to pass the data with setState but nothing happen... I am using: ```setstate() { NewWidget(image: uploadedImage) }``` – Tizi Dev Jun 21 '21 at 13:36

0 Answers0