I'm not sure what i'm missing i have this simple method with a Consumer class that returns a Dialog, but the problem is the following
The return type 'Future' isn't a 'Widget', as required by the closure's context.
it points to the line indicated below.
func() {
Consumer(builder: (context, ref, _) {
return showDialog( // <- [ERROR HERE]
context: context,
builder: (BuildContext context) {
return AlertDialog(
content: unrelatedfunc(),
actions: [
TextButton(
child: const Text('Share'),
onPressed: () {
submit();
_TextFieldController.clear();
Navigator.of(context).pop();
})
],
);
});
});
}
i'm not sure why but i have been investigating and i haven't seen an example like this