2

I am new to flutter, following the flutter.io and in widgets topic we have the Alert Dialog class widget, https://docs.flutter.io/flutter/material/AlertDialog-class.html

There we have some sample code and getting the below errors in it. Can anyone help in solving them.

screenshot

Thanks.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
Sai Sushmitha
  • 839
  • 1
  • 9
  • 11

1 Answers1

2

Because this method is defined what looks to be outside of a Widget class, the context member of a Widget class doesn't exist. You need to pass one into this method when you use.

Changed your method to this:

...
Future<void> _neverSatisfied(BuildContext context) async {
...
Tom Alabaster
  • 965
  • 6
  • 12