width property

double? get width

Do that:

return key.currentContext.size.width

Implementation

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