Skip to content

Commit

Permalink
Modernize MediaQuery usage (#520)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo Farias <[email protected]>
  • Loading branch information
cabaucom376 and leoafarias authored Nov 15, 2024
1 parent eac0d91 commit 9c35bbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OnBrightnessVariant extends MediaQueryContextVariant {
/// [brightness] associated with this variant, and `false` otherwise.
@override
bool when(BuildContext context) {
final mediaBrightness = MediaQuery.of(context).platformBrightness;
final mediaBrightness = MediaQuery.platformBrightnessOf(context);

return mediaBrightness == brightness;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OnOrientationVariant extends MediaQueryContextVariant {
/// [orientation] associated with this variant, and `false` otherwise.
@override
bool when(BuildContext context) {
return MediaQuery.of(context).orientation == orientation;
return MediaQuery.orientationOf(context) == orientation;
}

/// The properties used for equality comparison.
Expand Down

0 comments on commit 9c35bbc

Please sign in to comment.