Skip to content

Commit

Permalink
perf: don't rebuild for all mediaquery changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed May 16, 2024
1 parent 2af991c commit 846b591
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pages/play.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _PlayPageState extends State<PlayPage> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
RicochlimeGame.reduceMotion = MediaQuery.of(context).disableAnimations;
RicochlimeGame.reduceMotion = MediaQuery.disableAnimationsOf(context);
_isDarkMode.value = Theme.of(context).brightness == Brightness.dark;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class SettingsPage extends StatelessWidget {
padding: EdgeInsets.zero,
child: ListTile(
onTap: () {
final screenWidth = MediaQuery.of(context).size.width;
final screenWidth = MediaQuery.sizeOf(context).width;
final iconSize = min<double>(64, screenWidth * 0.15);
showAboutDialog(
context: context,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/tutorial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class _TutorialScreenshot extends StatelessWidget {

@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final size = MediaQuery.sizeOf(context);
if (size.width > TutorialPage.maxWidth) {
return ClipRRect(
borderRadius: BorderRadius.circular(8),
Expand Down

0 comments on commit 846b591

Please sign in to comment.