matches method
bool
matches({
- required BreakpointId activeBreakpointId,
- required Orientation currentOrientation,
- required AdaptivePlatform currentPlatform,
- required DeviceFormFactor currentFormFactor,
Checks if this configuration matches the given layout parameters.
activeBreakpointId: The current active breakpoint.
currentOrientation: The current screen orientation.
currentPlatform: The current platform (AdaptivePlatform).
currentFormFactor: The current device form factor (DeviceFormFactor).
Implementation
bool matches({
required BreakpointId activeBreakpointId,
required Orientation currentOrientation,
required AdaptivePlatform currentPlatform,
required DeviceFormFactor currentFormFactor, // Added parameter
}) {
bool platformMatch = platforms == null ||
platforms!.isEmpty ||
platforms!.contains(currentPlatform);
bool breakpointMatch =
breakpointMatcher == null || breakpointMatcher!(activeBreakpointId);
bool orientationMatch =
orientationMatcher == null || orientationMatcher == currentOrientation;
bool formFactorMatch = // Added check
formFactorMatcher == null || formFactorMatcher!(currentFormFactor);
return platformMatch &&
breakpointMatch &&
orientationMatch &&
formFactorMatch; // Added to return
}