matches method

bool matches({
  1. required BreakpointId activeBreakpointId,
  2. required Orientation currentOrientation,
  3. required AdaptivePlatform currentPlatform,
  4. 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
}