copyWith method Null safety

PlatformConfiguration copyWith(
  1. {AccessibilityFeatures? accessibilityFeatures,
  2. bool? alwaysUse24HourFormat,
  3. bool? semanticsEnabled,
  4. Brightness? platformBrightness,
  5. double? textScaleFactor,
  6. List<Locale>? locales,
  7. String? defaultRouteName,
  8. String? systemFontFamily}
)

Copy a PlatformConfiguration with some fields replaced.

Implementation

PlatformConfiguration copyWith({
  AccessibilityFeatures? accessibilityFeatures,
  bool? alwaysUse24HourFormat,
  bool? semanticsEnabled,
  Brightness? platformBrightness,
  double? textScaleFactor,
  List<Locale>? locales,
  String? defaultRouteName,
  String? systemFontFamily,
}) {
  return PlatformConfiguration(
    accessibilityFeatures: accessibilityFeatures ?? this.accessibilityFeatures,
    alwaysUse24HourFormat: alwaysUse24HourFormat ?? this.alwaysUse24HourFormat,
    semanticsEnabled: semanticsEnabled ?? this.semanticsEnabled,
    platformBrightness: platformBrightness ?? this.platformBrightness,
    textScaleFactor: textScaleFactor ?? this.textScaleFactor,
    locales: locales ?? this.locales,
    defaultRouteName: defaultRouteName ?? this.defaultRouteName,
    systemFontFamily: systemFontFamily ?? this.systemFontFamily,
  );
}