height property

double? get height

Do that:

return key.currentContext.size.height

Implementation

double? get height => currentContext?.size?.height;