Undefined name 'context'

前端 未结 1 1456
予麋鹿
予麋鹿 2021-01-22 15:08

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

1条回答
  •  感情败类
    2021-01-22 15:33

    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 _neverSatisfied(BuildContext context) async {
    ...
    

    0 讨论(0)
提交回复
热议问题