Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use MediaQuery.sizeOf instead of MediaQuery.of to prevent unneces…
…sary rebuilds
  • Loading branch information
waleedf112 committed Apr 16, 2024
commit 3cdb2b93fcee32cb88f379760f44928b58967087
4 changes: 2 additions & 2 deletions packages/flutter_adaptive_scaffold/lib/src/breakpoints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class WidthPlatformBreakpoint extends Breakpoint {

// Null boundaries are unbounded, assign the max/min of their associated
// direction on a number line.
final double width = MediaQuery.of(context).size.width;
final double width = MediaQuery.sizeOf(context).width;
final double lowerBound = begin ?? double.negativeInfinity;
final double upperBound = end ?? double.infinity;

Expand Down Expand Up @@ -126,6 +126,6 @@ abstract class Breakpoint {
const Breakpoint();

/// A method that returns true based on conditions related to the context of
/// the screen such as MediaQuery.of(context).size.width.
/// the screen such as MediaQuery.sizeOf(context).width.
bool isActive(BuildContext context);
}