Search code examples
flutterdartbuilder

The return type 'Future<dynamic>' isn't a 'Widget', as required by the closure's context. after adding const and also returning container doesn't work


I'm trying to make an image text recognition app where I pass image to methods for getting the result as recognized text, but I get the Future builder error while passing the image through the navigator push routing for a methos passing.

My Code is :

enter image description here

This is giving the error

enter image description here

enter image description here


Solution

  • for Navigator.push() & Navigator.pop() we use these to go to other files like classes from one class or file . here we're passing parameters as image file within methods within one class. So, in this case Navigator.push() isn't working out. Just the name of method with parameter would work like these scanText(image!);