You can do that in different ways:
Read moreWhat is a callback function in dart?
Dart allows callback functions but also provides the Future and Completer pair of types that work together to provide a future value that can be passed around your app . Only when the async call completes does the future value get a real value.
Read moreHow do you call a method from another class flutter?
To call a void function from another file in Flutter, what you have to do are:
Read more