Skip to content

Replace MediaQuery.sizeOf with heightOf and widthOf. #168478

@ksokolovskyi

Description

@ksokolovskyi

Use case

Recently, #167829 introduced MediaQuery.heightOf and MediaQuery.widthOf methods. After checking the Flutter repo, I noticed that 14 out of 28 calls to sizeOf use just one dimension.

Proposal

I'd like to propose the following:

  1. Replace MediaQuery.sizeOf(context).height with MediaQuery.heightOf(context)
  2. Replace MediaQuery.sizeOf(context).width with MediaQuery.widthOf(context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions