diff --git a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.dart b/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.dart deleted file mode 100644 index 1d77530f..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:stac/src/framework/ui/stac_outline_input_border.dart'; -import 'package:stac/src/parsers/foundation/borders/stac_border_radius_parser.dart'; -import 'package:stac/src/parsers/foundation/effects/stac_gradient_parser.dart'; -import 'package:stac/src/parsers/widgets/stac_double/stac_double.dart'; -import 'package:stac/src/utils/color_utils.dart'; -import 'package:stac_core/stac_core.dart'; - -part 'stac_input_border.freezed.dart'; -part 'stac_input_border.g.dart'; - -enum StacInputBorderType { none, underlineInputBorder, outlineInputBorder } - -@freezed -abstract class StacInputBorder with _$StacInputBorder { - const factory StacInputBorder({ - @Default(StacInputBorderType.underlineInputBorder) StacInputBorderType type, - StacBorderRadius? borderRadius, - @Default(4.0) double gapPadding, - @Default(StacDouble.zero) StacDouble width, - String? color, - StacGradient? gradient, - }) = _StacInputBorder; - - factory StacInputBorder.fromJson(Map json) => - _$StacInputBorderFromJson(json); -} - -extension StacInputBorderParser on StacInputBorder { - InputBorder parse(BuildContext context) { - switch (type) { - case StacInputBorderType.none: - return InputBorder.none; - case StacInputBorderType.underlineInputBorder: - return UnderlineInputBorder( - borderSide: BorderSide( - color: color?.toColor(context) ?? Colors.black, - width: width.parse, - ), - borderRadius: borderRadius?.parse ?? - const BorderRadius.only( - topLeft: Radius.circular(4.0), - topRight: Radius.circular(4.0), - ), - ); - case StacInputBorderType.outlineInputBorder: - return StacOutlineInputBorder( - width: width.parse, - borderRadius: - borderRadius?.parse ?? BorderRadius.all(Radius.circular(4.0)), - gapPadding: gapPadding, - color: color?.toColor(context) ?? Colors.black, - gradient: gradient?.parse(context), - ); - } - } -} diff --git a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.freezed.dart b/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.freezed.dart deleted file mode 100644 index 51608d4e..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.freezed.dart +++ /dev/null @@ -1,444 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'stac_input_border.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -// dart format off -T _$identity(T value) => value; - -/// @nodoc -mixin _$StacInputBorder { - StacInputBorderType get type; - StacBorderRadius? get borderRadius; - double get gapPadding; - StacDouble get width; - String? get color; - StacGradient? get gradient; - - /// Create a copy of StacInputBorder - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $StacInputBorderCopyWith get copyWith => - _$StacInputBorderCopyWithImpl( - this as StacInputBorder, _$identity); - - /// Serializes this StacInputBorder to a JSON map. - Map toJson(); - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is StacInputBorder && - (identical(other.type, type) || other.type == type) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius) && - (identical(other.gapPadding, gapPadding) || - other.gapPadding == gapPadding) && - (identical(other.width, width) || other.width == width) && - (identical(other.color, color) || other.color == color) && - (identical(other.gradient, gradient) || - other.gradient == gradient)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, type, borderRadius, gapPadding, width, color, gradient); - - @override - String toString() { - return 'StacInputBorder(type: $type, borderRadius: $borderRadius, gapPadding: $gapPadding, width: $width, color: $color, gradient: $gradient)'; - } -} - -/// @nodoc -abstract mixin class $StacInputBorderCopyWith<$Res> { - factory $StacInputBorderCopyWith( - StacInputBorder value, $Res Function(StacInputBorder) _then) = - _$StacInputBorderCopyWithImpl; - @useResult - $Res call( - {StacInputBorderType type, - StacBorderRadius? borderRadius, - double gapPadding, - StacDouble width, - String? color, - StacGradient? gradient}); -} - -/// @nodoc -class _$StacInputBorderCopyWithImpl<$Res> - implements $StacInputBorderCopyWith<$Res> { - _$StacInputBorderCopyWithImpl(this._self, this._then); - - final StacInputBorder _self; - final $Res Function(StacInputBorder) _then; - - /// Create a copy of StacInputBorder - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? borderRadius = freezed, - Object? gapPadding = null, - Object? width = null, - Object? color = freezed, - Object? gradient = freezed, - }) { - return _then(_self.copyWith( - type: null == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as StacInputBorderType, - borderRadius: freezed == borderRadius - ? _self.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as StacBorderRadius?, - gapPadding: null == gapPadding - ? _self.gapPadding - : gapPadding // ignore: cast_nullable_to_non_nullable - as double, - width: null == width - ? _self.width - : width // ignore: cast_nullable_to_non_nullable - as StacDouble, - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, - gradient: freezed == gradient - ? _self.gradient - : gradient // ignore: cast_nullable_to_non_nullable - as StacGradient?, - )); - } -} - -/// Adds pattern-matching-related methods to [StacInputBorder]. -extension StacInputBorderPatterns on StacInputBorder { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_StacInputBorder value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacInputBorder() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_StacInputBorder value) $default, - ) { - final _that = this; - switch (_that) { - case _StacInputBorder(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_StacInputBorder value)? $default, - ) { - final _that = this; - switch (_that) { - case _StacInputBorder() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - StacInputBorderType type, - StacBorderRadius? borderRadius, - double gapPadding, - StacDouble width, - String? color, - StacGradient? gradient)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacInputBorder() when $default != null: - return $default(_that.type, _that.borderRadius, _that.gapPadding, - _that.width, _that.color, _that.gradient); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - StacInputBorderType type, - StacBorderRadius? borderRadius, - double gapPadding, - StacDouble width, - String? color, - StacGradient? gradient) - $default, - ) { - final _that = this; - switch (_that) { - case _StacInputBorder(): - return $default(_that.type, _that.borderRadius, _that.gapPadding, - _that.width, _that.color, _that.gradient); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - StacInputBorderType type, - StacBorderRadius? borderRadius, - double gapPadding, - StacDouble width, - String? color, - StacGradient? gradient)? - $default, - ) { - final _that = this; - switch (_that) { - case _StacInputBorder() when $default != null: - return $default(_that.type, _that.borderRadius, _that.gapPadding, - _that.width, _that.color, _that.gradient); - case _: - return null; - } - } -} - -/// @nodoc -@JsonSerializable() -class _StacInputBorder implements StacInputBorder { - const _StacInputBorder( - {this.type = StacInputBorderType.underlineInputBorder, - this.borderRadius, - this.gapPadding = 4.0, - this.width = StacDouble.zero, - this.color, - this.gradient}); - factory _StacInputBorder.fromJson(Map json) => - _$StacInputBorderFromJson(json); - - @override - @JsonKey() - final StacInputBorderType type; - @override - final StacBorderRadius? borderRadius; - @override - @JsonKey() - final double gapPadding; - @override - @JsonKey() - final StacDouble width; - @override - final String? color; - @override - final StacGradient? gradient; - - /// Create a copy of StacInputBorder - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$StacInputBorderCopyWith<_StacInputBorder> get copyWith => - __$StacInputBorderCopyWithImpl<_StacInputBorder>(this, _$identity); - - @override - Map toJson() { - return _$StacInputBorderToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _StacInputBorder && - (identical(other.type, type) || other.type == type) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius) && - (identical(other.gapPadding, gapPadding) || - other.gapPadding == gapPadding) && - (identical(other.width, width) || other.width == width) && - (identical(other.color, color) || other.color == color) && - (identical(other.gradient, gradient) || - other.gradient == gradient)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, type, borderRadius, gapPadding, width, color, gradient); - - @override - String toString() { - return 'StacInputBorder(type: $type, borderRadius: $borderRadius, gapPadding: $gapPadding, width: $width, color: $color, gradient: $gradient)'; - } -} - -/// @nodoc -abstract mixin class _$StacInputBorderCopyWith<$Res> - implements $StacInputBorderCopyWith<$Res> { - factory _$StacInputBorderCopyWith( - _StacInputBorder value, $Res Function(_StacInputBorder) _then) = - __$StacInputBorderCopyWithImpl; - @override - @useResult - $Res call( - {StacInputBorderType type, - StacBorderRadius? borderRadius, - double gapPadding, - StacDouble width, - String? color, - StacGradient? gradient}); -} - -/// @nodoc -class __$StacInputBorderCopyWithImpl<$Res> - implements _$StacInputBorderCopyWith<$Res> { - __$StacInputBorderCopyWithImpl(this._self, this._then); - - final _StacInputBorder _self; - final $Res Function(_StacInputBorder) _then; - - /// Create a copy of StacInputBorder - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? type = null, - Object? borderRadius = freezed, - Object? gapPadding = null, - Object? width = null, - Object? color = freezed, - Object? gradient = freezed, - }) { - return _then(_StacInputBorder( - type: null == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as StacInputBorderType, - borderRadius: freezed == borderRadius - ? _self.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as StacBorderRadius?, - gapPadding: null == gapPadding - ? _self.gapPadding - : gapPadding // ignore: cast_nullable_to_non_nullable - as double, - width: null == width - ? _self.width - : width // ignore: cast_nullable_to_non_nullable - as StacDouble, - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, - gradient: freezed == gradient - ? _self.gradient - : gradient // ignore: cast_nullable_to_non_nullable - as StacGradient?, - )); - } -} - -// dart format on diff --git a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.g.dart b/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.g.dart deleted file mode 100644 index a1a2a685..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_input_border/stac_input_border.g.dart +++ /dev/null @@ -1,40 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'stac_input_border.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_StacInputBorder _$StacInputBorderFromJson(Map json) => - _StacInputBorder( - type: $enumDecodeNullable(_$StacInputBorderTypeEnumMap, json['type']) ?? - StacInputBorderType.underlineInputBorder, - borderRadius: json['borderRadius'] == null - ? null - : StacBorderRadius.fromJson(json['borderRadius']), - gapPadding: (json['gapPadding'] as num?)?.toDouble() ?? 4.0, - width: json['width'] == null - ? StacDouble.zero - : StacDouble.fromJson(json['width']), - color: json['color'] as String?, - gradient: json['gradient'] == null - ? null - : StacGradient.fromJson(json['gradient'] as Map), - ); - -Map _$StacInputBorderToJson(_StacInputBorder instance) => - { - 'type': _$StacInputBorderTypeEnumMap[instance.type]!, - 'borderRadius': instance.borderRadius, - 'gapPadding': instance.gapPadding, - 'width': instance.width, - 'color': instance.color, - 'gradient': instance.gradient, - }; - -const _$StacInputBorderTypeEnumMap = { - StacInputBorderType.none: 'none', - StacInputBorderType.underlineInputBorder: 'underlineInputBorder', - StacInputBorderType.outlineInputBorder: 'outlineInputBorder', -}; diff --git a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.dart b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.dart deleted file mode 100644 index 8bc793a7..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:stac/src/parsers/widgets/stac_double/stac_double.dart'; -import 'package:stac_core/stac_core.dart'; - -export 'stac_radio_parser.dart'; - -part 'stac_radio.freezed.dart'; -part 'stac_radio.g.dart'; - -enum StacRadioType { adaptive, cupertino, material } - -@freezed -abstract class StacRadio with _$StacRadio { - const factory StacRadio({ - @Default(StacRadioType.material) StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - @Default(false) bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - @Default(false) bool autofocus, - @Default(false) bool useCheckmarkStyle, - @Default(false) bool useCupertinoCheckmarkStyle, - }) = _StacRadio; - - factory StacRadio.fromJson(Map json) => - _$StacRadioFromJson(json); -} diff --git a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.freezed.dart b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.freezed.dart deleted file mode 100644 index 4b56ce5a..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.freezed.dart +++ /dev/null @@ -1,757 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'stac_radio.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -// dart format off -T _$identity(T value) => value; - -/// @nodoc -mixin _$StacRadio { - StacRadioType get radioType; - dynamic get value; - StacMouseCursor? get mouseCursor; - bool get toggleable; - String? get activeColor; - String? get inactiveColor; - String? get fillColor; - String? get focusColor; - String? get hoverColor; - String? get overlayColor; - StacDouble? get splashRadius; - MaterialTapTargetSize? get materialTapTargetSize; - StacVisualDensity? get visualDensity; - bool get autofocus; - bool get useCheckmarkStyle; - bool get useCupertinoCheckmarkStyle; - - /// Create a copy of StacRadio - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $StacRadioCopyWith get copyWith => - _$StacRadioCopyWithImpl(this as StacRadio, _$identity); - - /// Serializes this StacRadio to a JSON map. - Map toJson(); - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is StacRadio && - (identical(other.radioType, radioType) || - other.radioType == radioType) && - const DeepCollectionEquality().equals(other.value, value) && - (identical(other.mouseCursor, mouseCursor) || - other.mouseCursor == mouseCursor) && - (identical(other.toggleable, toggleable) || - other.toggleable == toggleable) && - (identical(other.activeColor, activeColor) || - other.activeColor == activeColor) && - (identical(other.inactiveColor, inactiveColor) || - other.inactiveColor == inactiveColor) && - (identical(other.fillColor, fillColor) || - other.fillColor == fillColor) && - (identical(other.focusColor, focusColor) || - other.focusColor == focusColor) && - (identical(other.hoverColor, hoverColor) || - other.hoverColor == hoverColor) && - (identical(other.overlayColor, overlayColor) || - other.overlayColor == overlayColor) && - (identical(other.splashRadius, splashRadius) || - other.splashRadius == splashRadius) && - (identical(other.materialTapTargetSize, materialTapTargetSize) || - other.materialTapTargetSize == materialTapTargetSize) && - (identical(other.visualDensity, visualDensity) || - other.visualDensity == visualDensity) && - (identical(other.autofocus, autofocus) || - other.autofocus == autofocus) && - (identical(other.useCheckmarkStyle, useCheckmarkStyle) || - other.useCheckmarkStyle == useCheckmarkStyle) && - (identical(other.useCupertinoCheckmarkStyle, - useCupertinoCheckmarkStyle) || - other.useCupertinoCheckmarkStyle == - useCupertinoCheckmarkStyle)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - radioType, - const DeepCollectionEquality().hash(value), - mouseCursor, - toggleable, - activeColor, - inactiveColor, - fillColor, - focusColor, - hoverColor, - overlayColor, - splashRadius, - materialTapTargetSize, - visualDensity, - autofocus, - useCheckmarkStyle, - useCupertinoCheckmarkStyle); - - @override - String toString() { - return 'StacRadio(radioType: $radioType, value: $value, mouseCursor: $mouseCursor, toggleable: $toggleable, activeColor: $activeColor, inactiveColor: $inactiveColor, fillColor: $fillColor, focusColor: $focusColor, hoverColor: $hoverColor, overlayColor: $overlayColor, splashRadius: $splashRadius, materialTapTargetSize: $materialTapTargetSize, visualDensity: $visualDensity, autofocus: $autofocus, useCheckmarkStyle: $useCheckmarkStyle, useCupertinoCheckmarkStyle: $useCupertinoCheckmarkStyle)'; - } -} - -/// @nodoc -abstract mixin class $StacRadioCopyWith<$Res> { - factory $StacRadioCopyWith(StacRadio value, $Res Function(StacRadio) _then) = - _$StacRadioCopyWithImpl; - @useResult - $Res call( - {StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - bool autofocus, - bool useCheckmarkStyle, - bool useCupertinoCheckmarkStyle}); -} - -/// @nodoc -class _$StacRadioCopyWithImpl<$Res> implements $StacRadioCopyWith<$Res> { - _$StacRadioCopyWithImpl(this._self, this._then); - - final StacRadio _self; - final $Res Function(StacRadio) _then; - - /// Create a copy of StacRadio - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? radioType = null, - Object? value = freezed, - Object? mouseCursor = freezed, - Object? toggleable = null, - Object? activeColor = freezed, - Object? inactiveColor = freezed, - Object? fillColor = freezed, - Object? focusColor = freezed, - Object? hoverColor = freezed, - Object? overlayColor = freezed, - Object? splashRadius = freezed, - Object? materialTapTargetSize = freezed, - Object? visualDensity = freezed, - Object? autofocus = null, - Object? useCheckmarkStyle = null, - Object? useCupertinoCheckmarkStyle = null, - }) { - return _then(_self.copyWith( - radioType: null == radioType - ? _self.radioType - : radioType // ignore: cast_nullable_to_non_nullable - as StacRadioType, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as dynamic, - mouseCursor: freezed == mouseCursor - ? _self.mouseCursor - : mouseCursor // ignore: cast_nullable_to_non_nullable - as StacMouseCursor?, - toggleable: null == toggleable - ? _self.toggleable - : toggleable // ignore: cast_nullable_to_non_nullable - as bool, - activeColor: freezed == activeColor - ? _self.activeColor - : activeColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveColor: freezed == inactiveColor - ? _self.inactiveColor - : inactiveColor // ignore: cast_nullable_to_non_nullable - as String?, - fillColor: freezed == fillColor - ? _self.fillColor - : fillColor // ignore: cast_nullable_to_non_nullable - as String?, - focusColor: freezed == focusColor - ? _self.focusColor - : focusColor // ignore: cast_nullable_to_non_nullable - as String?, - hoverColor: freezed == hoverColor - ? _self.hoverColor - : hoverColor // ignore: cast_nullable_to_non_nullable - as String?, - overlayColor: freezed == overlayColor - ? _self.overlayColor - : overlayColor // ignore: cast_nullable_to_non_nullable - as String?, - splashRadius: freezed == splashRadius - ? _self.splashRadius - : splashRadius // ignore: cast_nullable_to_non_nullable - as StacDouble?, - materialTapTargetSize: freezed == materialTapTargetSize - ? _self.materialTapTargetSize - : materialTapTargetSize // ignore: cast_nullable_to_non_nullable - as MaterialTapTargetSize?, - visualDensity: freezed == visualDensity - ? _self.visualDensity - : visualDensity // ignore: cast_nullable_to_non_nullable - as StacVisualDensity?, - autofocus: null == autofocus - ? _self.autofocus - : autofocus // ignore: cast_nullable_to_non_nullable - as bool, - useCheckmarkStyle: null == useCheckmarkStyle - ? _self.useCheckmarkStyle - : useCheckmarkStyle // ignore: cast_nullable_to_non_nullable - as bool, - useCupertinoCheckmarkStyle: null == useCupertinoCheckmarkStyle - ? _self.useCupertinoCheckmarkStyle - : useCupertinoCheckmarkStyle // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// Adds pattern-matching-related methods to [StacRadio]. -extension StacRadioPatterns on StacRadio { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_StacRadio value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacRadio() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_StacRadio value) $default, - ) { - final _that = this; - switch (_that) { - case _StacRadio(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_StacRadio value)? $default, - ) { - final _that = this; - switch (_that) { - case _StacRadio() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - bool autofocus, - bool useCheckmarkStyle, - bool useCupertinoCheckmarkStyle)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacRadio() when $default != null: - return $default( - _that.radioType, - _that.value, - _that.mouseCursor, - _that.toggleable, - _that.activeColor, - _that.inactiveColor, - _that.fillColor, - _that.focusColor, - _that.hoverColor, - _that.overlayColor, - _that.splashRadius, - _that.materialTapTargetSize, - _that.visualDensity, - _that.autofocus, - _that.useCheckmarkStyle, - _that.useCupertinoCheckmarkStyle); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - bool autofocus, - bool useCheckmarkStyle, - bool useCupertinoCheckmarkStyle) - $default, - ) { - final _that = this; - switch (_that) { - case _StacRadio(): - return $default( - _that.radioType, - _that.value, - _that.mouseCursor, - _that.toggleable, - _that.activeColor, - _that.inactiveColor, - _that.fillColor, - _that.focusColor, - _that.hoverColor, - _that.overlayColor, - _that.splashRadius, - _that.materialTapTargetSize, - _that.visualDensity, - _that.autofocus, - _that.useCheckmarkStyle, - _that.useCupertinoCheckmarkStyle); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - bool autofocus, - bool useCheckmarkStyle, - bool useCupertinoCheckmarkStyle)? - $default, - ) { - final _that = this; - switch (_that) { - case _StacRadio() when $default != null: - return $default( - _that.radioType, - _that.value, - _that.mouseCursor, - _that.toggleable, - _that.activeColor, - _that.inactiveColor, - _that.fillColor, - _that.focusColor, - _that.hoverColor, - _that.overlayColor, - _that.splashRadius, - _that.materialTapTargetSize, - _that.visualDensity, - _that.autofocus, - _that.useCheckmarkStyle, - _that.useCupertinoCheckmarkStyle); - case _: - return null; - } - } -} - -/// @nodoc -@JsonSerializable() -class _StacRadio implements StacRadio { - const _StacRadio( - {this.radioType = StacRadioType.material, - this.value, - this.mouseCursor, - this.toggleable = false, - this.activeColor, - this.inactiveColor, - this.fillColor, - this.focusColor, - this.hoverColor, - this.overlayColor, - this.splashRadius, - this.materialTapTargetSize, - this.visualDensity, - this.autofocus = false, - this.useCheckmarkStyle = false, - this.useCupertinoCheckmarkStyle = false}); - factory _StacRadio.fromJson(Map json) => - _$StacRadioFromJson(json); - - @override - @JsonKey() - final StacRadioType radioType; - @override - final dynamic value; - @override - final StacMouseCursor? mouseCursor; - @override - @JsonKey() - final bool toggleable; - @override - final String? activeColor; - @override - final String? inactiveColor; - @override - final String? fillColor; - @override - final String? focusColor; - @override - final String? hoverColor; - @override - final String? overlayColor; - @override - final StacDouble? splashRadius; - @override - final MaterialTapTargetSize? materialTapTargetSize; - @override - final StacVisualDensity? visualDensity; - @override - @JsonKey() - final bool autofocus; - @override - @JsonKey() - final bool useCheckmarkStyle; - @override - @JsonKey() - final bool useCupertinoCheckmarkStyle; - - /// Create a copy of StacRadio - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$StacRadioCopyWith<_StacRadio> get copyWith => - __$StacRadioCopyWithImpl<_StacRadio>(this, _$identity); - - @override - Map toJson() { - return _$StacRadioToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _StacRadio && - (identical(other.radioType, radioType) || - other.radioType == radioType) && - const DeepCollectionEquality().equals(other.value, value) && - (identical(other.mouseCursor, mouseCursor) || - other.mouseCursor == mouseCursor) && - (identical(other.toggleable, toggleable) || - other.toggleable == toggleable) && - (identical(other.activeColor, activeColor) || - other.activeColor == activeColor) && - (identical(other.inactiveColor, inactiveColor) || - other.inactiveColor == inactiveColor) && - (identical(other.fillColor, fillColor) || - other.fillColor == fillColor) && - (identical(other.focusColor, focusColor) || - other.focusColor == focusColor) && - (identical(other.hoverColor, hoverColor) || - other.hoverColor == hoverColor) && - (identical(other.overlayColor, overlayColor) || - other.overlayColor == overlayColor) && - (identical(other.splashRadius, splashRadius) || - other.splashRadius == splashRadius) && - (identical(other.materialTapTargetSize, materialTapTargetSize) || - other.materialTapTargetSize == materialTapTargetSize) && - (identical(other.visualDensity, visualDensity) || - other.visualDensity == visualDensity) && - (identical(other.autofocus, autofocus) || - other.autofocus == autofocus) && - (identical(other.useCheckmarkStyle, useCheckmarkStyle) || - other.useCheckmarkStyle == useCheckmarkStyle) && - (identical(other.useCupertinoCheckmarkStyle, - useCupertinoCheckmarkStyle) || - other.useCupertinoCheckmarkStyle == - useCupertinoCheckmarkStyle)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - radioType, - const DeepCollectionEquality().hash(value), - mouseCursor, - toggleable, - activeColor, - inactiveColor, - fillColor, - focusColor, - hoverColor, - overlayColor, - splashRadius, - materialTapTargetSize, - visualDensity, - autofocus, - useCheckmarkStyle, - useCupertinoCheckmarkStyle); - - @override - String toString() { - return 'StacRadio(radioType: $radioType, value: $value, mouseCursor: $mouseCursor, toggleable: $toggleable, activeColor: $activeColor, inactiveColor: $inactiveColor, fillColor: $fillColor, focusColor: $focusColor, hoverColor: $hoverColor, overlayColor: $overlayColor, splashRadius: $splashRadius, materialTapTargetSize: $materialTapTargetSize, visualDensity: $visualDensity, autofocus: $autofocus, useCheckmarkStyle: $useCheckmarkStyle, useCupertinoCheckmarkStyle: $useCupertinoCheckmarkStyle)'; - } -} - -/// @nodoc -abstract mixin class _$StacRadioCopyWith<$Res> - implements $StacRadioCopyWith<$Res> { - factory _$StacRadioCopyWith( - _StacRadio value, $Res Function(_StacRadio) _then) = - __$StacRadioCopyWithImpl; - @override - @useResult - $Res call( - {StacRadioType radioType, - dynamic value, - StacMouseCursor? mouseCursor, - bool toggleable, - String? activeColor, - String? inactiveColor, - String? fillColor, - String? focusColor, - String? hoverColor, - String? overlayColor, - StacDouble? splashRadius, - MaterialTapTargetSize? materialTapTargetSize, - StacVisualDensity? visualDensity, - bool autofocus, - bool useCheckmarkStyle, - bool useCupertinoCheckmarkStyle}); -} - -/// @nodoc -class __$StacRadioCopyWithImpl<$Res> implements _$StacRadioCopyWith<$Res> { - __$StacRadioCopyWithImpl(this._self, this._then); - - final _StacRadio _self; - final $Res Function(_StacRadio) _then; - - /// Create a copy of StacRadio - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? radioType = null, - Object? value = freezed, - Object? mouseCursor = freezed, - Object? toggleable = null, - Object? activeColor = freezed, - Object? inactiveColor = freezed, - Object? fillColor = freezed, - Object? focusColor = freezed, - Object? hoverColor = freezed, - Object? overlayColor = freezed, - Object? splashRadius = freezed, - Object? materialTapTargetSize = freezed, - Object? visualDensity = freezed, - Object? autofocus = null, - Object? useCheckmarkStyle = null, - Object? useCupertinoCheckmarkStyle = null, - }) { - return _then(_StacRadio( - radioType: null == radioType - ? _self.radioType - : radioType // ignore: cast_nullable_to_non_nullable - as StacRadioType, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as dynamic, - mouseCursor: freezed == mouseCursor - ? _self.mouseCursor - : mouseCursor // ignore: cast_nullable_to_non_nullable - as StacMouseCursor?, - toggleable: null == toggleable - ? _self.toggleable - : toggleable // ignore: cast_nullable_to_non_nullable - as bool, - activeColor: freezed == activeColor - ? _self.activeColor - : activeColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveColor: freezed == inactiveColor - ? _self.inactiveColor - : inactiveColor // ignore: cast_nullable_to_non_nullable - as String?, - fillColor: freezed == fillColor - ? _self.fillColor - : fillColor // ignore: cast_nullable_to_non_nullable - as String?, - focusColor: freezed == focusColor - ? _self.focusColor - : focusColor // ignore: cast_nullable_to_non_nullable - as String?, - hoverColor: freezed == hoverColor - ? _self.hoverColor - : hoverColor // ignore: cast_nullable_to_non_nullable - as String?, - overlayColor: freezed == overlayColor - ? _self.overlayColor - : overlayColor // ignore: cast_nullable_to_non_nullable - as String?, - splashRadius: freezed == splashRadius - ? _self.splashRadius - : splashRadius // ignore: cast_nullable_to_non_nullable - as StacDouble?, - materialTapTargetSize: freezed == materialTapTargetSize - ? _self.materialTapTargetSize - : materialTapTargetSize // ignore: cast_nullable_to_non_nullable - as MaterialTapTargetSize?, - visualDensity: freezed == visualDensity - ? _self.visualDensity - : visualDensity // ignore: cast_nullable_to_non_nullable - as StacVisualDensity?, - autofocus: null == autofocus - ? _self.autofocus - : autofocus // ignore: cast_nullable_to_non_nullable - as bool, - useCheckmarkStyle: null == useCheckmarkStyle - ? _self.useCheckmarkStyle - : useCheckmarkStyle // ignore: cast_nullable_to_non_nullable - as bool, - useCupertinoCheckmarkStyle: null == useCupertinoCheckmarkStyle - ? _self.useCupertinoCheckmarkStyle - : useCupertinoCheckmarkStyle // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -// dart format on diff --git a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.g.dart b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.g.dart deleted file mode 100644 index 2d13d16d..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.g.dart +++ /dev/null @@ -1,107 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'stac_radio.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_StacRadio _$StacRadioFromJson(Map json) => _StacRadio( - radioType: - $enumDecodeNullable(_$StacRadioTypeEnumMap, json['radioType']) ?? - StacRadioType.material, - value: json['value'], - mouseCursor: - $enumDecodeNullable(_$StacMouseCursorEnumMap, json['mouseCursor']), - toggleable: json['toggleable'] as bool? ?? false, - activeColor: json['activeColor'] as String?, - inactiveColor: json['inactiveColor'] as String?, - fillColor: json['fillColor'] as String?, - focusColor: json['focusColor'] as String?, - hoverColor: json['hoverColor'] as String?, - overlayColor: json['overlayColor'] as String?, - splashRadius: json['splashRadius'] == null - ? null - : StacDouble.fromJson(json['splashRadius']), - materialTapTargetSize: $enumDecodeNullable( - _$MaterialTapTargetSizeEnumMap, json['materialTapTargetSize']), - visualDensity: json['visualDensity'] == null - ? null - : StacVisualDensity.fromJson( - json['visualDensity'] as Map), - autofocus: json['autofocus'] as bool? ?? false, - useCheckmarkStyle: json['useCheckmarkStyle'] as bool? ?? false, - useCupertinoCheckmarkStyle: - json['useCupertinoCheckmarkStyle'] as bool? ?? false, - ); - -Map _$StacRadioToJson(_StacRadio instance) => - { - 'radioType': _$StacRadioTypeEnumMap[instance.radioType]!, - 'value': instance.value, - 'mouseCursor': _$StacMouseCursorEnumMap[instance.mouseCursor], - 'toggleable': instance.toggleable, - 'activeColor': instance.activeColor, - 'inactiveColor': instance.inactiveColor, - 'fillColor': instance.fillColor, - 'focusColor': instance.focusColor, - 'hoverColor': instance.hoverColor, - 'overlayColor': instance.overlayColor, - 'splashRadius': instance.splashRadius, - 'materialTapTargetSize': - _$MaterialTapTargetSizeEnumMap[instance.materialTapTargetSize], - 'visualDensity': instance.visualDensity, - 'autofocus': instance.autofocus, - 'useCheckmarkStyle': instance.useCheckmarkStyle, - 'useCupertinoCheckmarkStyle': instance.useCupertinoCheckmarkStyle, - }; - -const _$StacRadioTypeEnumMap = { - StacRadioType.adaptive: 'adaptive', - StacRadioType.cupertino: 'cupertino', - StacRadioType.material: 'material', -}; - -const _$StacMouseCursorEnumMap = { - StacMouseCursor.none: 'none', - StacMouseCursor.basic: 'basic', - StacMouseCursor.click: 'click', - StacMouseCursor.forbidden: 'forbidden', - StacMouseCursor.wait: 'wait', - StacMouseCursor.progress: 'progress', - StacMouseCursor.contextMenu: 'contextMenu', - StacMouseCursor.help: 'help', - StacMouseCursor.text: 'text', - StacMouseCursor.verticalText: 'verticalText', - StacMouseCursor.cell: 'cell', - StacMouseCursor.precise: 'precise', - StacMouseCursor.move: 'move', - StacMouseCursor.grab: 'grab', - StacMouseCursor.grabbing: 'grabbing', - StacMouseCursor.noDrop: 'noDrop', - StacMouseCursor.alias: 'alias', - StacMouseCursor.copy: 'copy', - StacMouseCursor.disappearing: 'disappearing', - StacMouseCursor.allScroll: 'allScroll', - StacMouseCursor.resizeLeftRight: 'resizeLeftRight', - StacMouseCursor.resizeUpDown: 'resizeUpDown', - StacMouseCursor.resizeUpLeftDownRight: 'resizeUpLeftDownRight', - StacMouseCursor.resizeUpRightDownLeft: 'resizeUpRightDownLeft', - StacMouseCursor.resizeUp: 'resizeUp', - StacMouseCursor.resizeDown: 'resizeDown', - StacMouseCursor.resizeLeft: 'resizeLeft', - StacMouseCursor.resizeRight: 'resizeRight', - StacMouseCursor.resizeUpLeft: 'resizeUpLeft', - StacMouseCursor.resizeUpRight: 'resizeUpRight', - StacMouseCursor.resizeDownLeft: 'resizeDownLeft', - StacMouseCursor.resizeDownRight: 'resizeDownRight', - StacMouseCursor.resizeColumn: 'resizeColumn', - StacMouseCursor.resizeRow: 'resizeRow', - StacMouseCursor.zoomIn: 'zoomIn', - StacMouseCursor.zoomOut: 'zoomOut', -}; - -const _$MaterialTapTargetSizeEnumMap = { - MaterialTapTargetSize.padded: 'padded', - MaterialTapTargetSize.shrinkWrap: 'shrinkWrap', -}; diff --git a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.dart b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.dart deleted file mode 100644 index 00754348..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:stac/src/parsers/theme/stac_material_color/stac_material_color.dart'; -import 'package:stac/src/parsers/widgets/stac_double/stac_double.dart'; - -export 'stac_switch_parser.dart'; - -part 'stac_switch.freezed.dart'; -part 'stac_switch.g.dart'; - -enum StacSwitchType { adaptive, cupertino, material } - -@freezed -abstract class StacSwitch with _$StacSwitch { - const factory StacSwitch({ - @Default(StacSwitchType.material) StacSwitchType switchType, - @Default(false) value, - Map? onChanged, - @Default(false) bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - @Default(DragStartBehavior.start) DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme, - }) = _StacSwitch; - - factory StacSwitch.fromJson(Map json) => - _$StacSwitchFromJson(json); -} diff --git a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.freezed.dart b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.freezed.dart deleted file mode 100644 index e00d3edc..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.freezed.dart +++ /dev/null @@ -1,1149 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'stac_switch.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -// dart format off -T _$identity(T value) => value; - -/// @nodoc -mixin _$StacSwitch { - StacSwitchType get switchType; - dynamic get value; - Map? get onChanged; - bool get autofocus; - String? get activeThumbColor; - String? get activeTrackColor; - String? get focusColor; - String? get hoverColor; - String? get inactiveThumbColor; - String? get inactiveTrackColor; - String? get onLabelColor; - String? get offLabelColor; - StacDouble? get splashRadius; - DragStartBehavior get dragStartBehavior; - StacMaterialColor? get overlayColor; - StacMaterialColor? get thumbColor; - StacMaterialColor? get trackColor; - MaterialTapTargetSize? get materialTapTargetSize; - StacMaterialColor? get trackOutlineColor; - StacDouble? get trackOutlineWidth; - Map? get thumbIcon; - String? get inactiveThumbImage; - String? get activeThumbImage; - bool? get applyTheme; - bool? get applyCupertinoTheme; - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $StacSwitchCopyWith get copyWith => - _$StacSwitchCopyWithImpl(this as StacSwitch, _$identity); - - /// Serializes this StacSwitch to a JSON map. - Map toJson(); - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is StacSwitch && - (identical(other.switchType, switchType) || - other.switchType == switchType) && - const DeepCollectionEquality().equals(other.value, value) && - const DeepCollectionEquality().equals(other.onChanged, onChanged) && - (identical(other.autofocus, autofocus) || - other.autofocus == autofocus) && - (identical(other.activeThumbColor, activeThumbColor) || - other.activeThumbColor == activeThumbColor) && - (identical(other.activeTrackColor, activeTrackColor) || - other.activeTrackColor == activeTrackColor) && - (identical(other.focusColor, focusColor) || - other.focusColor == focusColor) && - (identical(other.hoverColor, hoverColor) || - other.hoverColor == hoverColor) && - (identical(other.inactiveThumbColor, inactiveThumbColor) || - other.inactiveThumbColor == inactiveThumbColor) && - (identical(other.inactiveTrackColor, inactiveTrackColor) || - other.inactiveTrackColor == inactiveTrackColor) && - (identical(other.onLabelColor, onLabelColor) || - other.onLabelColor == onLabelColor) && - (identical(other.offLabelColor, offLabelColor) || - other.offLabelColor == offLabelColor) && - (identical(other.splashRadius, splashRadius) || - other.splashRadius == splashRadius) && - (identical(other.dragStartBehavior, dragStartBehavior) || - other.dragStartBehavior == dragStartBehavior) && - (identical(other.overlayColor, overlayColor) || - other.overlayColor == overlayColor) && - (identical(other.thumbColor, thumbColor) || - other.thumbColor == thumbColor) && - (identical(other.trackColor, trackColor) || - other.trackColor == trackColor) && - (identical(other.materialTapTargetSize, materialTapTargetSize) || - other.materialTapTargetSize == materialTapTargetSize) && - (identical(other.trackOutlineColor, trackOutlineColor) || - other.trackOutlineColor == trackOutlineColor) && - (identical(other.trackOutlineWidth, trackOutlineWidth) || - other.trackOutlineWidth == trackOutlineWidth) && - const DeepCollectionEquality().equals(other.thumbIcon, thumbIcon) && - (identical(other.inactiveThumbImage, inactiveThumbImage) || - other.inactiveThumbImage == inactiveThumbImage) && - (identical(other.activeThumbImage, activeThumbImage) || - other.activeThumbImage == activeThumbImage) && - (identical(other.applyTheme, applyTheme) || - other.applyTheme == applyTheme) && - (identical(other.applyCupertinoTheme, applyCupertinoTheme) || - other.applyCupertinoTheme == applyCupertinoTheme)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - switchType, - const DeepCollectionEquality().hash(value), - const DeepCollectionEquality().hash(onChanged), - autofocus, - activeThumbColor, - activeTrackColor, - focusColor, - hoverColor, - inactiveThumbColor, - inactiveTrackColor, - onLabelColor, - offLabelColor, - splashRadius, - dragStartBehavior, - overlayColor, - thumbColor, - trackColor, - materialTapTargetSize, - trackOutlineColor, - trackOutlineWidth, - const DeepCollectionEquality().hash(thumbIcon), - inactiveThumbImage, - activeThumbImage, - applyTheme, - applyCupertinoTheme - ]); - - @override - String toString() { - return 'StacSwitch(switchType: $switchType, value: $value, onChanged: $onChanged, autofocus: $autofocus, activeThumbColor: $activeThumbColor, activeTrackColor: $activeTrackColor, focusColor: $focusColor, hoverColor: $hoverColor, inactiveThumbColor: $inactiveThumbColor, inactiveTrackColor: $inactiveTrackColor, onLabelColor: $onLabelColor, offLabelColor: $offLabelColor, splashRadius: $splashRadius, dragStartBehavior: $dragStartBehavior, overlayColor: $overlayColor, thumbColor: $thumbColor, trackColor: $trackColor, materialTapTargetSize: $materialTapTargetSize, trackOutlineColor: $trackOutlineColor, trackOutlineWidth: $trackOutlineWidth, thumbIcon: $thumbIcon, inactiveThumbImage: $inactiveThumbImage, activeThumbImage: $activeThumbImage, applyTheme: $applyTheme, applyCupertinoTheme: $applyCupertinoTheme)'; - } -} - -/// @nodoc -abstract mixin class $StacSwitchCopyWith<$Res> { - factory $StacSwitchCopyWith( - StacSwitch value, $Res Function(StacSwitch) _then) = - _$StacSwitchCopyWithImpl; - @useResult - $Res call( - {StacSwitchType switchType, - dynamic value, - Map? onChanged, - bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme}); - - $StacMaterialColorCopyWith<$Res>? get overlayColor; - $StacMaterialColorCopyWith<$Res>? get thumbColor; - $StacMaterialColorCopyWith<$Res>? get trackColor; - $StacMaterialColorCopyWith<$Res>? get trackOutlineColor; -} - -/// @nodoc -class _$StacSwitchCopyWithImpl<$Res> implements $StacSwitchCopyWith<$Res> { - _$StacSwitchCopyWithImpl(this._self, this._then); - - final StacSwitch _self; - final $Res Function(StacSwitch) _then; - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? switchType = null, - Object? value = freezed, - Object? onChanged = freezed, - Object? autofocus = null, - Object? activeThumbColor = freezed, - Object? activeTrackColor = freezed, - Object? focusColor = freezed, - Object? hoverColor = freezed, - Object? inactiveThumbColor = freezed, - Object? inactiveTrackColor = freezed, - Object? onLabelColor = freezed, - Object? offLabelColor = freezed, - Object? splashRadius = freezed, - Object? dragStartBehavior = null, - Object? overlayColor = freezed, - Object? thumbColor = freezed, - Object? trackColor = freezed, - Object? materialTapTargetSize = freezed, - Object? trackOutlineColor = freezed, - Object? trackOutlineWidth = freezed, - Object? thumbIcon = freezed, - Object? inactiveThumbImage = freezed, - Object? activeThumbImage = freezed, - Object? applyTheme = freezed, - Object? applyCupertinoTheme = freezed, - }) { - return _then(_self.copyWith( - switchType: null == switchType - ? _self.switchType - : switchType // ignore: cast_nullable_to_non_nullable - as StacSwitchType, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as dynamic, - onChanged: freezed == onChanged - ? _self.onChanged - : onChanged // ignore: cast_nullable_to_non_nullable - as Map?, - autofocus: null == autofocus - ? _self.autofocus - : autofocus // ignore: cast_nullable_to_non_nullable - as bool, - activeThumbColor: freezed == activeThumbColor - ? _self.activeThumbColor - : activeThumbColor // ignore: cast_nullable_to_non_nullable - as String?, - activeTrackColor: freezed == activeTrackColor - ? _self.activeTrackColor - : activeTrackColor // ignore: cast_nullable_to_non_nullable - as String?, - focusColor: freezed == focusColor - ? _self.focusColor - : focusColor // ignore: cast_nullable_to_non_nullable - as String?, - hoverColor: freezed == hoverColor - ? _self.hoverColor - : hoverColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveThumbColor: freezed == inactiveThumbColor - ? _self.inactiveThumbColor - : inactiveThumbColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveTrackColor: freezed == inactiveTrackColor - ? _self.inactiveTrackColor - : inactiveTrackColor // ignore: cast_nullable_to_non_nullable - as String?, - onLabelColor: freezed == onLabelColor - ? _self.onLabelColor - : onLabelColor // ignore: cast_nullable_to_non_nullable - as String?, - offLabelColor: freezed == offLabelColor - ? _self.offLabelColor - : offLabelColor // ignore: cast_nullable_to_non_nullable - as String?, - splashRadius: freezed == splashRadius - ? _self.splashRadius - : splashRadius // ignore: cast_nullable_to_non_nullable - as StacDouble?, - dragStartBehavior: null == dragStartBehavior - ? _self.dragStartBehavior - : dragStartBehavior // ignore: cast_nullable_to_non_nullable - as DragStartBehavior, - overlayColor: freezed == overlayColor - ? _self.overlayColor - : overlayColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - thumbColor: freezed == thumbColor - ? _self.thumbColor - : thumbColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - trackColor: freezed == trackColor - ? _self.trackColor - : trackColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - materialTapTargetSize: freezed == materialTapTargetSize - ? _self.materialTapTargetSize - : materialTapTargetSize // ignore: cast_nullable_to_non_nullable - as MaterialTapTargetSize?, - trackOutlineColor: freezed == trackOutlineColor - ? _self.trackOutlineColor - : trackOutlineColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - trackOutlineWidth: freezed == trackOutlineWidth - ? _self.trackOutlineWidth - : trackOutlineWidth // ignore: cast_nullable_to_non_nullable - as StacDouble?, - thumbIcon: freezed == thumbIcon - ? _self.thumbIcon - : thumbIcon // ignore: cast_nullable_to_non_nullable - as Map?, - inactiveThumbImage: freezed == inactiveThumbImage - ? _self.inactiveThumbImage - : inactiveThumbImage // ignore: cast_nullable_to_non_nullable - as String?, - activeThumbImage: freezed == activeThumbImage - ? _self.activeThumbImage - : activeThumbImage // ignore: cast_nullable_to_non_nullable - as String?, - applyTheme: freezed == applyTheme - ? _self.applyTheme - : applyTheme // ignore: cast_nullable_to_non_nullable - as bool?, - applyCupertinoTheme: freezed == applyCupertinoTheme - ? _self.applyCupertinoTheme - : applyCupertinoTheme // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get overlayColor { - if (_self.overlayColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.overlayColor!, (value) { - return _then(_self.copyWith(overlayColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get thumbColor { - if (_self.thumbColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.thumbColor!, (value) { - return _then(_self.copyWith(thumbColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get trackColor { - if (_self.trackColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.trackColor!, (value) { - return _then(_self.copyWith(trackColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get trackOutlineColor { - if (_self.trackOutlineColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.trackOutlineColor!, (value) { - return _then(_self.copyWith(trackOutlineColor: value)); - }); - } -} - -/// Adds pattern-matching-related methods to [StacSwitch]. -extension StacSwitchPatterns on StacSwitch { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_StacSwitch value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacSwitch() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_StacSwitch value) $default, - ) { - final _that = this; - switch (_that) { - case _StacSwitch(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_StacSwitch value)? $default, - ) { - final _that = this; - switch (_that) { - case _StacSwitch() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - StacSwitchType switchType, - dynamic value, - Map? onChanged, - bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacSwitch() when $default != null: - return $default( - _that.switchType, - _that.value, - _that.onChanged, - _that.autofocus, - _that.activeThumbColor, - _that.activeTrackColor, - _that.focusColor, - _that.hoverColor, - _that.inactiveThumbColor, - _that.inactiveTrackColor, - _that.onLabelColor, - _that.offLabelColor, - _that.splashRadius, - _that.dragStartBehavior, - _that.overlayColor, - _that.thumbColor, - _that.trackColor, - _that.materialTapTargetSize, - _that.trackOutlineColor, - _that.trackOutlineWidth, - _that.thumbIcon, - _that.inactiveThumbImage, - _that.activeThumbImage, - _that.applyTheme, - _that.applyCupertinoTheme); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - StacSwitchType switchType, - dynamic value, - Map? onChanged, - bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme) - $default, - ) { - final _that = this; - switch (_that) { - case _StacSwitch(): - return $default( - _that.switchType, - _that.value, - _that.onChanged, - _that.autofocus, - _that.activeThumbColor, - _that.activeTrackColor, - _that.focusColor, - _that.hoverColor, - _that.inactiveThumbColor, - _that.inactiveTrackColor, - _that.onLabelColor, - _that.offLabelColor, - _that.splashRadius, - _that.dragStartBehavior, - _that.overlayColor, - _that.thumbColor, - _that.trackColor, - _that.materialTapTargetSize, - _that.trackOutlineColor, - _that.trackOutlineWidth, - _that.thumbIcon, - _that.inactiveThumbImage, - _that.activeThumbImage, - _that.applyTheme, - _that.applyCupertinoTheme); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - StacSwitchType switchType, - dynamic value, - Map? onChanged, - bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme)? - $default, - ) { - final _that = this; - switch (_that) { - case _StacSwitch() when $default != null: - return $default( - _that.switchType, - _that.value, - _that.onChanged, - _that.autofocus, - _that.activeThumbColor, - _that.activeTrackColor, - _that.focusColor, - _that.hoverColor, - _that.inactiveThumbColor, - _that.inactiveTrackColor, - _that.onLabelColor, - _that.offLabelColor, - _that.splashRadius, - _that.dragStartBehavior, - _that.overlayColor, - _that.thumbColor, - _that.trackColor, - _that.materialTapTargetSize, - _that.trackOutlineColor, - _that.trackOutlineWidth, - _that.thumbIcon, - _that.inactiveThumbImage, - _that.activeThumbImage, - _that.applyTheme, - _that.applyCupertinoTheme); - case _: - return null; - } - } -} - -/// @nodoc -@JsonSerializable() -class _StacSwitch implements StacSwitch { - const _StacSwitch( - {this.switchType = StacSwitchType.material, - this.value = false, - final Map? onChanged, - this.autofocus = false, - this.activeThumbColor, - this.activeTrackColor, - this.focusColor, - this.hoverColor, - this.inactiveThumbColor, - this.inactiveTrackColor, - this.onLabelColor, - this.offLabelColor, - this.splashRadius, - this.dragStartBehavior = DragStartBehavior.start, - this.overlayColor, - this.thumbColor, - this.trackColor, - this.materialTapTargetSize, - this.trackOutlineColor, - this.trackOutlineWidth, - final Map? thumbIcon, - this.inactiveThumbImage, - this.activeThumbImage, - this.applyTheme, - this.applyCupertinoTheme}) - : _onChanged = onChanged, - _thumbIcon = thumbIcon; - factory _StacSwitch.fromJson(Map json) => - _$StacSwitchFromJson(json); - - @override - @JsonKey() - final StacSwitchType switchType; - @override - @JsonKey() - final dynamic value; - final Map? _onChanged; - @override - Map? get onChanged { - final value = _onChanged; - if (value == null) return null; - if (_onChanged is EqualUnmodifiableMapView) return _onChanged; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - @JsonKey() - final bool autofocus; - @override - final String? activeThumbColor; - @override - final String? activeTrackColor; - @override - final String? focusColor; - @override - final String? hoverColor; - @override - final String? inactiveThumbColor; - @override - final String? inactiveTrackColor; - @override - final String? onLabelColor; - @override - final String? offLabelColor; - @override - final StacDouble? splashRadius; - @override - @JsonKey() - final DragStartBehavior dragStartBehavior; - @override - final StacMaterialColor? overlayColor; - @override - final StacMaterialColor? thumbColor; - @override - final StacMaterialColor? trackColor; - @override - final MaterialTapTargetSize? materialTapTargetSize; - @override - final StacMaterialColor? trackOutlineColor; - @override - final StacDouble? trackOutlineWidth; - final Map? _thumbIcon; - @override - Map? get thumbIcon { - final value = _thumbIcon; - if (value == null) return null; - if (_thumbIcon is EqualUnmodifiableMapView) return _thumbIcon; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - final String? inactiveThumbImage; - @override - final String? activeThumbImage; - @override - final bool? applyTheme; - @override - final bool? applyCupertinoTheme; - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$StacSwitchCopyWith<_StacSwitch> get copyWith => - __$StacSwitchCopyWithImpl<_StacSwitch>(this, _$identity); - - @override - Map toJson() { - return _$StacSwitchToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _StacSwitch && - (identical(other.switchType, switchType) || - other.switchType == switchType) && - const DeepCollectionEquality().equals(other.value, value) && - const DeepCollectionEquality() - .equals(other._onChanged, _onChanged) && - (identical(other.autofocus, autofocus) || - other.autofocus == autofocus) && - (identical(other.activeThumbColor, activeThumbColor) || - other.activeThumbColor == activeThumbColor) && - (identical(other.activeTrackColor, activeTrackColor) || - other.activeTrackColor == activeTrackColor) && - (identical(other.focusColor, focusColor) || - other.focusColor == focusColor) && - (identical(other.hoverColor, hoverColor) || - other.hoverColor == hoverColor) && - (identical(other.inactiveThumbColor, inactiveThumbColor) || - other.inactiveThumbColor == inactiveThumbColor) && - (identical(other.inactiveTrackColor, inactiveTrackColor) || - other.inactiveTrackColor == inactiveTrackColor) && - (identical(other.onLabelColor, onLabelColor) || - other.onLabelColor == onLabelColor) && - (identical(other.offLabelColor, offLabelColor) || - other.offLabelColor == offLabelColor) && - (identical(other.splashRadius, splashRadius) || - other.splashRadius == splashRadius) && - (identical(other.dragStartBehavior, dragStartBehavior) || - other.dragStartBehavior == dragStartBehavior) && - (identical(other.overlayColor, overlayColor) || - other.overlayColor == overlayColor) && - (identical(other.thumbColor, thumbColor) || - other.thumbColor == thumbColor) && - (identical(other.trackColor, trackColor) || - other.trackColor == trackColor) && - (identical(other.materialTapTargetSize, materialTapTargetSize) || - other.materialTapTargetSize == materialTapTargetSize) && - (identical(other.trackOutlineColor, trackOutlineColor) || - other.trackOutlineColor == trackOutlineColor) && - (identical(other.trackOutlineWidth, trackOutlineWidth) || - other.trackOutlineWidth == trackOutlineWidth) && - const DeepCollectionEquality() - .equals(other._thumbIcon, _thumbIcon) && - (identical(other.inactiveThumbImage, inactiveThumbImage) || - other.inactiveThumbImage == inactiveThumbImage) && - (identical(other.activeThumbImage, activeThumbImage) || - other.activeThumbImage == activeThumbImage) && - (identical(other.applyTheme, applyTheme) || - other.applyTheme == applyTheme) && - (identical(other.applyCupertinoTheme, applyCupertinoTheme) || - other.applyCupertinoTheme == applyCupertinoTheme)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - switchType, - const DeepCollectionEquality().hash(value), - const DeepCollectionEquality().hash(_onChanged), - autofocus, - activeThumbColor, - activeTrackColor, - focusColor, - hoverColor, - inactiveThumbColor, - inactiveTrackColor, - onLabelColor, - offLabelColor, - splashRadius, - dragStartBehavior, - overlayColor, - thumbColor, - trackColor, - materialTapTargetSize, - trackOutlineColor, - trackOutlineWidth, - const DeepCollectionEquality().hash(_thumbIcon), - inactiveThumbImage, - activeThumbImage, - applyTheme, - applyCupertinoTheme - ]); - - @override - String toString() { - return 'StacSwitch(switchType: $switchType, value: $value, onChanged: $onChanged, autofocus: $autofocus, activeThumbColor: $activeThumbColor, activeTrackColor: $activeTrackColor, focusColor: $focusColor, hoverColor: $hoverColor, inactiveThumbColor: $inactiveThumbColor, inactiveTrackColor: $inactiveTrackColor, onLabelColor: $onLabelColor, offLabelColor: $offLabelColor, splashRadius: $splashRadius, dragStartBehavior: $dragStartBehavior, overlayColor: $overlayColor, thumbColor: $thumbColor, trackColor: $trackColor, materialTapTargetSize: $materialTapTargetSize, trackOutlineColor: $trackOutlineColor, trackOutlineWidth: $trackOutlineWidth, thumbIcon: $thumbIcon, inactiveThumbImage: $inactiveThumbImage, activeThumbImage: $activeThumbImage, applyTheme: $applyTheme, applyCupertinoTheme: $applyCupertinoTheme)'; - } -} - -/// @nodoc -abstract mixin class _$StacSwitchCopyWith<$Res> - implements $StacSwitchCopyWith<$Res> { - factory _$StacSwitchCopyWith( - _StacSwitch value, $Res Function(_StacSwitch) _then) = - __$StacSwitchCopyWithImpl; - @override - @useResult - $Res call( - {StacSwitchType switchType, - dynamic value, - Map? onChanged, - bool autofocus, - String? activeThumbColor, - String? activeTrackColor, - String? focusColor, - String? hoverColor, - String? inactiveThumbColor, - String? inactiveTrackColor, - String? onLabelColor, - String? offLabelColor, - StacDouble? splashRadius, - DragStartBehavior dragStartBehavior, - StacMaterialColor? overlayColor, - StacMaterialColor? thumbColor, - StacMaterialColor? trackColor, - MaterialTapTargetSize? materialTapTargetSize, - StacMaterialColor? trackOutlineColor, - StacDouble? trackOutlineWidth, - Map? thumbIcon, - String? inactiveThumbImage, - String? activeThumbImage, - bool? applyTheme, - bool? applyCupertinoTheme}); - - @override - $StacMaterialColorCopyWith<$Res>? get overlayColor; - @override - $StacMaterialColorCopyWith<$Res>? get thumbColor; - @override - $StacMaterialColorCopyWith<$Res>? get trackColor; - @override - $StacMaterialColorCopyWith<$Res>? get trackOutlineColor; -} - -/// @nodoc -class __$StacSwitchCopyWithImpl<$Res> implements _$StacSwitchCopyWith<$Res> { - __$StacSwitchCopyWithImpl(this._self, this._then); - - final _StacSwitch _self; - final $Res Function(_StacSwitch) _then; - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? switchType = null, - Object? value = freezed, - Object? onChanged = freezed, - Object? autofocus = null, - Object? activeThumbColor = freezed, - Object? activeTrackColor = freezed, - Object? focusColor = freezed, - Object? hoverColor = freezed, - Object? inactiveThumbColor = freezed, - Object? inactiveTrackColor = freezed, - Object? onLabelColor = freezed, - Object? offLabelColor = freezed, - Object? splashRadius = freezed, - Object? dragStartBehavior = null, - Object? overlayColor = freezed, - Object? thumbColor = freezed, - Object? trackColor = freezed, - Object? materialTapTargetSize = freezed, - Object? trackOutlineColor = freezed, - Object? trackOutlineWidth = freezed, - Object? thumbIcon = freezed, - Object? inactiveThumbImage = freezed, - Object? activeThumbImage = freezed, - Object? applyTheme = freezed, - Object? applyCupertinoTheme = freezed, - }) { - return _then(_StacSwitch( - switchType: null == switchType - ? _self.switchType - : switchType // ignore: cast_nullable_to_non_nullable - as StacSwitchType, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as dynamic, - onChanged: freezed == onChanged - ? _self._onChanged - : onChanged // ignore: cast_nullable_to_non_nullable - as Map?, - autofocus: null == autofocus - ? _self.autofocus - : autofocus // ignore: cast_nullable_to_non_nullable - as bool, - activeThumbColor: freezed == activeThumbColor - ? _self.activeThumbColor - : activeThumbColor // ignore: cast_nullable_to_non_nullable - as String?, - activeTrackColor: freezed == activeTrackColor - ? _self.activeTrackColor - : activeTrackColor // ignore: cast_nullable_to_non_nullable - as String?, - focusColor: freezed == focusColor - ? _self.focusColor - : focusColor // ignore: cast_nullable_to_non_nullable - as String?, - hoverColor: freezed == hoverColor - ? _self.hoverColor - : hoverColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveThumbColor: freezed == inactiveThumbColor - ? _self.inactiveThumbColor - : inactiveThumbColor // ignore: cast_nullable_to_non_nullable - as String?, - inactiveTrackColor: freezed == inactiveTrackColor - ? _self.inactiveTrackColor - : inactiveTrackColor // ignore: cast_nullable_to_non_nullable - as String?, - onLabelColor: freezed == onLabelColor - ? _self.onLabelColor - : onLabelColor // ignore: cast_nullable_to_non_nullable - as String?, - offLabelColor: freezed == offLabelColor - ? _self.offLabelColor - : offLabelColor // ignore: cast_nullable_to_non_nullable - as String?, - splashRadius: freezed == splashRadius - ? _self.splashRadius - : splashRadius // ignore: cast_nullable_to_non_nullable - as StacDouble?, - dragStartBehavior: null == dragStartBehavior - ? _self.dragStartBehavior - : dragStartBehavior // ignore: cast_nullable_to_non_nullable - as DragStartBehavior, - overlayColor: freezed == overlayColor - ? _self.overlayColor - : overlayColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - thumbColor: freezed == thumbColor - ? _self.thumbColor - : thumbColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - trackColor: freezed == trackColor - ? _self.trackColor - : trackColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - materialTapTargetSize: freezed == materialTapTargetSize - ? _self.materialTapTargetSize - : materialTapTargetSize // ignore: cast_nullable_to_non_nullable - as MaterialTapTargetSize?, - trackOutlineColor: freezed == trackOutlineColor - ? _self.trackOutlineColor - : trackOutlineColor // ignore: cast_nullable_to_non_nullable - as StacMaterialColor?, - trackOutlineWidth: freezed == trackOutlineWidth - ? _self.trackOutlineWidth - : trackOutlineWidth // ignore: cast_nullable_to_non_nullable - as StacDouble?, - thumbIcon: freezed == thumbIcon - ? _self._thumbIcon - : thumbIcon // ignore: cast_nullable_to_non_nullable - as Map?, - inactiveThumbImage: freezed == inactiveThumbImage - ? _self.inactiveThumbImage - : inactiveThumbImage // ignore: cast_nullable_to_non_nullable - as String?, - activeThumbImage: freezed == activeThumbImage - ? _self.activeThumbImage - : activeThumbImage // ignore: cast_nullable_to_non_nullable - as String?, - applyTheme: freezed == applyTheme - ? _self.applyTheme - : applyTheme // ignore: cast_nullable_to_non_nullable - as bool?, - applyCupertinoTheme: freezed == applyCupertinoTheme - ? _self.applyCupertinoTheme - : applyCupertinoTheme // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get overlayColor { - if (_self.overlayColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.overlayColor!, (value) { - return _then(_self.copyWith(overlayColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get thumbColor { - if (_self.thumbColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.thumbColor!, (value) { - return _then(_self.copyWith(thumbColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get trackColor { - if (_self.trackColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.trackColor!, (value) { - return _then(_self.copyWith(trackColor: value)); - }); - } - - /// Create a copy of StacSwitch - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StacMaterialColorCopyWith<$Res>? get trackOutlineColor { - if (_self.trackOutlineColor == null) { - return null; - } - - return $StacMaterialColorCopyWith<$Res>(_self.trackOutlineColor!, (value) { - return _then(_self.copyWith(trackOutlineColor: value)); - }); - } -} - -// dart format on diff --git a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.g.dart b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.g.dart deleted file mode 100644 index ca57d9f6..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.g.dart +++ /dev/null @@ -1,103 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'stac_switch.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_StacSwitch _$StacSwitchFromJson(Map json) => _StacSwitch( - switchType: - $enumDecodeNullable(_$StacSwitchTypeEnumMap, json['switchType']) ?? - StacSwitchType.material, - value: json['value'] ?? false, - onChanged: json['onChanged'] as Map?, - autofocus: json['autofocus'] as bool? ?? false, - activeThumbColor: json['activeThumbColor'] as String?, - activeTrackColor: json['activeTrackColor'] as String?, - focusColor: json['focusColor'] as String?, - hoverColor: json['hoverColor'] as String?, - inactiveThumbColor: json['inactiveThumbColor'] as String?, - inactiveTrackColor: json['inactiveTrackColor'] as String?, - onLabelColor: json['onLabelColor'] as String?, - offLabelColor: json['offLabelColor'] as String?, - splashRadius: json['splashRadius'] == null - ? null - : StacDouble.fromJson(json['splashRadius']), - dragStartBehavior: $enumDecodeNullable( - _$DragStartBehaviorEnumMap, json['dragStartBehavior']) ?? - DragStartBehavior.start, - overlayColor: json['overlayColor'] == null - ? null - : StacMaterialColor.fromJson( - json['overlayColor'] as Map), - thumbColor: json['thumbColor'] == null - ? null - : StacMaterialColor.fromJson( - json['thumbColor'] as Map), - trackColor: json['trackColor'] == null - ? null - : StacMaterialColor.fromJson( - json['trackColor'] as Map), - materialTapTargetSize: $enumDecodeNullable( - _$MaterialTapTargetSizeEnumMap, json['materialTapTargetSize']), - trackOutlineColor: json['trackOutlineColor'] == null - ? null - : StacMaterialColor.fromJson( - json['trackOutlineColor'] as Map), - trackOutlineWidth: json['trackOutlineWidth'] == null - ? null - : StacDouble.fromJson(json['trackOutlineWidth']), - thumbIcon: json['thumbIcon'] as Map?, - inactiveThumbImage: json['inactiveThumbImage'] as String?, - activeThumbImage: json['activeThumbImage'] as String?, - applyTheme: json['applyTheme'] as bool?, - applyCupertinoTheme: json['applyCupertinoTheme'] as bool?, - ); - -Map _$StacSwitchToJson(_StacSwitch instance) => - { - 'switchType': _$StacSwitchTypeEnumMap[instance.switchType]!, - 'value': instance.value, - 'onChanged': instance.onChanged, - 'autofocus': instance.autofocus, - 'activeThumbColor': instance.activeThumbColor, - 'activeTrackColor': instance.activeTrackColor, - 'focusColor': instance.focusColor, - 'hoverColor': instance.hoverColor, - 'inactiveThumbColor': instance.inactiveThumbColor, - 'inactiveTrackColor': instance.inactiveTrackColor, - 'onLabelColor': instance.onLabelColor, - 'offLabelColor': instance.offLabelColor, - 'splashRadius': instance.splashRadius, - 'dragStartBehavior': - _$DragStartBehaviorEnumMap[instance.dragStartBehavior]!, - 'overlayColor': instance.overlayColor, - 'thumbColor': instance.thumbColor, - 'trackColor': instance.trackColor, - 'materialTapTargetSize': - _$MaterialTapTargetSizeEnumMap[instance.materialTapTargetSize], - 'trackOutlineColor': instance.trackOutlineColor, - 'trackOutlineWidth': instance.trackOutlineWidth, - 'thumbIcon': instance.thumbIcon, - 'inactiveThumbImage': instance.inactiveThumbImage, - 'activeThumbImage': instance.activeThumbImage, - 'applyTheme': instance.applyTheme, - 'applyCupertinoTheme': instance.applyCupertinoTheme, - }; - -const _$StacSwitchTypeEnumMap = { - StacSwitchType.adaptive: 'adaptive', - StacSwitchType.cupertino: 'cupertino', - StacSwitchType.material: 'material', -}; - -const _$DragStartBehaviorEnumMap = { - DragStartBehavior.down: 'down', - DragStartBehavior.start: 'start', -}; - -const _$MaterialTapTargetSizeEnumMap = { - MaterialTapTargetSize.padded: 'padded', - MaterialTapTargetSize.shrinkWrap: 'shrinkWrap', -};