context property

BuildContext? get context

Do that:

return key.currentContext

Implementation

BuildContext? get context => currentContext;