diff --git a/examples/counter_example/pubspec.lock b/examples/counter_example/pubspec.lock index ebed3309..813a56ca 100644 --- a/examples/counter_example/pubspec.lock +++ b/examples/counter_example/pubspec.lock @@ -399,26 +399,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -726,7 +726,7 @@ packages: path: "../../packages/stac" relative: true source: path - version: "1.0.0-dev.5" + version: "1.0.0-dev.6" stac_framework: dependency: "direct overridden" description: @@ -793,10 +793,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" timing: dependency: transitive description: @@ -849,10 +849,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -918,5 +918,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=3.27.0" diff --git a/examples/movie_app/pubspec.lock b/examples/movie_app/pubspec.lock index dc988505..47394e96 100644 --- a/examples/movie_app/pubspec.lock +++ b/examples/movie_app/pubspec.lock @@ -207,26 +207,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -446,7 +446,7 @@ packages: path: "../../packages/stac" relative: true source: path - version: "1.0.0-dev.5" + version: "1.0.0-dev.6" stac_framework: dependency: "direct overridden" description: @@ -505,10 +505,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" typed_data: dependency: transitive description: @@ -553,10 +553,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -590,5 +590,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.7.2 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=3.27.0" diff --git a/examples/stac_gallery/lib/app/example/example_screen_parser.dart b/examples/stac_gallery/lib/app/example/example_screen_parser.dart index 53118549..36eaef14 100644 --- a/examples/stac_gallery/lib/app/example/example_screen_parser.dart +++ b/examples/stac_gallery/lib/app/example/example_screen_parser.dart @@ -40,7 +40,7 @@ class ExampleScreenParser extends StacParser { ), Switch( value: state.themeMode == ThemeMode.dark, - activeColor: Theme.of(context).colorScheme.primary, + activeThumbColor: Theme.of(context).colorScheme.primary, activeTrackColor: Theme.of(context).colorScheme.onSurface, inactiveTrackColor: Theme.of(context).colorScheme.primary.withAlpha(80), diff --git a/examples/stac_gallery/pubspec.lock b/examples/stac_gallery/pubspec.lock index 760cc126..e3ed3ec0 100644 --- a/examples/stac_gallery/pubspec.lock +++ b/examples/stac_gallery/pubspec.lock @@ -399,26 +399,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -726,7 +726,7 @@ packages: path: "../../packages/stac" relative: true source: path - version: "1.0.0-dev.5" + version: "1.0.0-dev.6" stac_framework: dependency: "direct overridden" description: @@ -800,10 +800,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" timing: dependency: transitive description: @@ -856,10 +856,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -957,5 +957,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=3.27.0" diff --git a/packages/stac/CHANGELOG.md b/packages/stac/CHANGELOG.md index 8220df65..88aeaef2 100644 --- a/packages/stac/CHANGELOG.md +++ b/packages/stac/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.0.0-dev.6 + +* BREAKING: Minimum Flutter SDK is now 3.35.0+ +* BREAKING: Switch — rename `activeColor` → `activeThumbColor` (align with Flutter API). Update your JSON accordingly +* BREAKING: `ThemeData.bottomAppBarTheme` now expects `BottomAppBarThemeData` (aligned with Flutter 3.35). No JSON change for `StacBottomAppBarTheme` +* docs: Updated Switch and Radio docs; added guidance for RadioGroup usage +* chore: Static analysis cleanups for latest Flutter + ## 1.0.0-dev.5 * feat: WASM compatibility for Web/WASM platform support diff --git a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.dart b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.dart index 4a5e9829..49a04b1d 100644 --- a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.dart +++ b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.dart @@ -11,7 +11,6 @@ part 'stac_app_bar_theme.g.dart'; @freezed abstract class StacAppBarTheme with _$StacAppBarTheme { const factory StacAppBarTheme({ - String? color, String? backgroundColor, String? foregroundColor, double? elevation, @@ -37,7 +36,6 @@ abstract class StacAppBarTheme with _$StacAppBarTheme { extension StacAppBarThemeParser on StacAppBarTheme { AppBarTheme? parse(BuildContext context) { return AppBarTheme( - color: color.toColor(context), backgroundColor: backgroundColor.toColor(context), foregroundColor: foregroundColor.toColor(context), elevation: elevation, diff --git a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.freezed.dart b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.freezed.dart index 610cd5ca..138b032f 100644 --- a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.freezed.dart +++ b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.freezed.dart @@ -15,7 +15,6 @@ T _$identity(T value) => value; /// @nodoc mixin _$StacAppBarTheme { - String? get color; String? get backgroundColor; String? get foregroundColor; double? get elevation; @@ -49,7 +48,6 @@ mixin _$StacAppBarTheme { return identical(this, other) || (other.runtimeType == runtimeType && other is StacAppBarTheme && - (identical(other.color, color) || other.color == color) && (identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor) && (identical(other.foregroundColor, foregroundColor) || @@ -87,7 +85,6 @@ mixin _$StacAppBarTheme { @override int get hashCode => Object.hash( runtimeType, - color, backgroundColor, foregroundColor, elevation, @@ -107,7 +104,7 @@ mixin _$StacAppBarTheme { @override String toString() { - return 'StacAppBarTheme(color: $color, backgroundColor: $backgroundColor, foregroundColor: $foregroundColor, elevation: $elevation, scrolledUnderElevation: $scrolledUnderElevation, shadowColor: $shadowColor, surfaceTintColor: $surfaceTintColor, shape: $shape, iconTheme: $iconTheme, actionsIconTheme: $actionsIconTheme, centerTitle: $centerTitle, titleSpacing: $titleSpacing, toolbarHeight: $toolbarHeight, toolbarTextStyle: $toolbarTextStyle, titleTextStyle: $titleTextStyle, systemOverlayStyle: $systemOverlayStyle, actionsPadding: $actionsPadding)'; + return 'StacAppBarTheme(backgroundColor: $backgroundColor, foregroundColor: $foregroundColor, elevation: $elevation, scrolledUnderElevation: $scrolledUnderElevation, shadowColor: $shadowColor, surfaceTintColor: $surfaceTintColor, shape: $shape, iconTheme: $iconTheme, actionsIconTheme: $actionsIconTheme, centerTitle: $centerTitle, titleSpacing: $titleSpacing, toolbarHeight: $toolbarHeight, toolbarTextStyle: $toolbarTextStyle, titleTextStyle: $titleTextStyle, systemOverlayStyle: $systemOverlayStyle, actionsPadding: $actionsPadding)'; } } @@ -118,8 +115,7 @@ abstract mixin class $StacAppBarThemeCopyWith<$Res> { _$StacAppBarThemeCopyWithImpl; @useResult $Res call( - {String? color, - String? backgroundColor, + {String? backgroundColor, String? foregroundColor, double? elevation, double? scrolledUnderElevation, @@ -158,7 +154,6 @@ class _$StacAppBarThemeCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? color = freezed, Object? backgroundColor = freezed, Object? foregroundColor = freezed, Object? elevation = freezed, @@ -177,10 +172,6 @@ class _$StacAppBarThemeCopyWithImpl<$Res> Object? actionsPadding = freezed, }) { return _then(_self.copyWith( - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable @@ -352,8 +343,7 @@ class _$StacAppBarThemeCopyWithImpl<$Res> @JsonSerializable() class _StacAppBarTheme implements StacAppBarTheme { const _StacAppBarTheme( - {this.color, - this.backgroundColor, + {this.backgroundColor, this.foregroundColor, this.elevation, this.scrolledUnderElevation, @@ -372,8 +362,6 @@ class _StacAppBarTheme implements StacAppBarTheme { factory _StacAppBarTheme.fromJson(Map json) => _$StacAppBarThemeFromJson(json); - @override - final String? color; @override final String? backgroundColor; @override @@ -427,7 +415,6 @@ class _StacAppBarTheme implements StacAppBarTheme { return identical(this, other) || (other.runtimeType == runtimeType && other is _StacAppBarTheme && - (identical(other.color, color) || other.color == color) && (identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor) && (identical(other.foregroundColor, foregroundColor) || @@ -465,7 +452,6 @@ class _StacAppBarTheme implements StacAppBarTheme { @override int get hashCode => Object.hash( runtimeType, - color, backgroundColor, foregroundColor, elevation, @@ -485,7 +471,7 @@ class _StacAppBarTheme implements StacAppBarTheme { @override String toString() { - return 'StacAppBarTheme(color: $color, backgroundColor: $backgroundColor, foregroundColor: $foregroundColor, elevation: $elevation, scrolledUnderElevation: $scrolledUnderElevation, shadowColor: $shadowColor, surfaceTintColor: $surfaceTintColor, shape: $shape, iconTheme: $iconTheme, actionsIconTheme: $actionsIconTheme, centerTitle: $centerTitle, titleSpacing: $titleSpacing, toolbarHeight: $toolbarHeight, toolbarTextStyle: $toolbarTextStyle, titleTextStyle: $titleTextStyle, systemOverlayStyle: $systemOverlayStyle, actionsPadding: $actionsPadding)'; + return 'StacAppBarTheme(backgroundColor: $backgroundColor, foregroundColor: $foregroundColor, elevation: $elevation, scrolledUnderElevation: $scrolledUnderElevation, shadowColor: $shadowColor, surfaceTintColor: $surfaceTintColor, shape: $shape, iconTheme: $iconTheme, actionsIconTheme: $actionsIconTheme, centerTitle: $centerTitle, titleSpacing: $titleSpacing, toolbarHeight: $toolbarHeight, toolbarTextStyle: $toolbarTextStyle, titleTextStyle: $titleTextStyle, systemOverlayStyle: $systemOverlayStyle, actionsPadding: $actionsPadding)'; } } @@ -498,8 +484,7 @@ abstract mixin class _$StacAppBarThemeCopyWith<$Res> @override @useResult $Res call( - {String? color, - String? backgroundColor, + {String? backgroundColor, String? foregroundColor, double? elevation, double? scrolledUnderElevation, @@ -545,7 +530,6 @@ class __$StacAppBarThemeCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({ - Object? color = freezed, Object? backgroundColor = freezed, Object? foregroundColor = freezed, Object? elevation = freezed, @@ -564,10 +548,6 @@ class __$StacAppBarThemeCopyWithImpl<$Res> Object? actionsPadding = freezed, }) { return _then(_StacAppBarTheme( - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable diff --git a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.g.dart b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.g.dart index c27bac4d..ad0447f7 100644 --- a/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.g.dart +++ b/packages/stac/lib/src/parsers/theme/stac_app_bar_theme/stac_app_bar_theme.g.dart @@ -8,7 +8,6 @@ part of 'stac_app_bar_theme.dart'; _StacAppBarTheme _$StacAppBarThemeFromJson(Map json) => _StacAppBarTheme( - color: json['color'] as String?, backgroundColor: json['backgroundColor'] as String?, foregroundColor: json['foregroundColor'] as String?, elevation: (json['elevation'] as num?)?.toDouble(), @@ -47,7 +46,6 @@ _StacAppBarTheme _$StacAppBarThemeFromJson(Map json) => Map _$StacAppBarThemeToJson(_StacAppBarTheme instance) => { - 'color': instance.color, 'backgroundColor': instance.backgroundColor, 'foregroundColor': instance.foregroundColor, 'elevation': instance.elevation, diff --git a/packages/stac/lib/src/parsers/theme/stac_bottom_app_bar_theme/stac_bottom_app_bar_theme.dart b/packages/stac/lib/src/parsers/theme/stac_bottom_app_bar_theme/stac_bottom_app_bar_theme.dart index c6a3dba4..4831bec3 100644 --- a/packages/stac/lib/src/parsers/theme/stac_bottom_app_bar_theme/stac_bottom_app_bar_theme.dart +++ b/packages/stac/lib/src/parsers/theme/stac_bottom_app_bar_theme/stac_bottom_app_bar_theme.dart @@ -22,8 +22,8 @@ abstract class StacBottomAppBarTheme with _$StacBottomAppBarTheme { } extension StacBottomAppBarThemeParser on StacBottomAppBarTheme { - BottomAppBarTheme? parse(BuildContext context) { - return BottomAppBarTheme( + BottomAppBarThemeData? parse(BuildContext context) { + return BottomAppBarThemeData( color: color?.toColor(context), elevation: elevation, height: height, 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 index f48f713d..5bdb095b 100644 --- a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.dart +++ b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio.dart @@ -16,7 +16,6 @@ abstract class StacRadio with _$StacRadio { const factory StacRadio({ @Default(StacRadioType.material) StacRadioType radioType, dynamic value, - Map? onChanged, StacMouseCursor? mouseCursor, @Default(false) bool toggleable, String? activeColor, 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 index f22a0f74..4296eb4e 100644 --- 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 @@ -17,7 +17,6 @@ T _$identity(T value) => value; mixin _$StacRadio { StacRadioType get radioType; dynamic get value; - Map? get onChanged; StacMouseCursor? get mouseCursor; bool get toggleable; String? get activeColor; @@ -51,7 +50,6 @@ mixin _$StacRadio { (identical(other.radioType, radioType) || other.radioType == radioType) && const DeepCollectionEquality().equals(other.value, value) && - const DeepCollectionEquality().equals(other.onChanged, onChanged) && (identical(other.mouseCursor, mouseCursor) || other.mouseCursor == mouseCursor) && (identical(other.toggleable, toggleable) || @@ -90,7 +88,6 @@ mixin _$StacRadio { runtimeType, radioType, const DeepCollectionEquality().hash(value), - const DeepCollectionEquality().hash(onChanged), mouseCursor, toggleable, activeColor, @@ -108,7 +105,7 @@ mixin _$StacRadio { @override String toString() { - return 'StacRadio(radioType: $radioType, value: $value, onChanged: $onChanged, 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)'; + 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)'; } } @@ -120,7 +117,6 @@ abstract mixin class $StacRadioCopyWith<$Res> { $Res call( {StacRadioType radioType, dynamic value, - Map? onChanged, StacMouseCursor? mouseCursor, bool toggleable, String? activeColor, @@ -153,7 +149,6 @@ class _$StacRadioCopyWithImpl<$Res> implements $StacRadioCopyWith<$Res> { $Res call({ Object? radioType = null, Object? value = freezed, - Object? onChanged = freezed, Object? mouseCursor = freezed, Object? toggleable = null, Object? activeColor = freezed, @@ -178,10 +173,6 @@ class _$StacRadioCopyWithImpl<$Res> implements $StacRadioCopyWith<$Res> { ? _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?, mouseCursor: freezed == mouseCursor ? _self.mouseCursor : mouseCursor // ignore: cast_nullable_to_non_nullable @@ -262,7 +253,6 @@ class _StacRadio implements StacRadio { const _StacRadio( {this.radioType = StacRadioType.material, this.value, - final Map? onChanged, this.mouseCursor, this.toggleable = false, this.activeColor, @@ -276,8 +266,7 @@ class _StacRadio implements StacRadio { this.visualDensity, this.autofocus = false, this.useCheckmarkStyle = false, - this.useCupertinoCheckmarkStyle = false}) - : _onChanged = onChanged; + this.useCupertinoCheckmarkStyle = false}); factory _StacRadio.fromJson(Map json) => _$StacRadioFromJson(json); @@ -286,16 +275,6 @@ class _StacRadio implements StacRadio { final StacRadioType radioType; @override 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 final StacMouseCursor? mouseCursor; @override @@ -352,8 +331,6 @@ class _StacRadio implements StacRadio { (identical(other.radioType, radioType) || other.radioType == radioType) && const DeepCollectionEquality().equals(other.value, value) && - const DeepCollectionEquality() - .equals(other._onChanged, _onChanged) && (identical(other.mouseCursor, mouseCursor) || other.mouseCursor == mouseCursor) && (identical(other.toggleable, toggleable) || @@ -392,7 +369,6 @@ class _StacRadio implements StacRadio { runtimeType, radioType, const DeepCollectionEquality().hash(value), - const DeepCollectionEquality().hash(_onChanged), mouseCursor, toggleable, activeColor, @@ -410,7 +386,7 @@ class _StacRadio implements StacRadio { @override String toString() { - return 'StacRadio(radioType: $radioType, value: $value, onChanged: $onChanged, 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)'; + 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)'; } } @@ -425,7 +401,6 @@ abstract mixin class _$StacRadioCopyWith<$Res> $Res call( {StacRadioType radioType, dynamic value, - Map? onChanged, StacMouseCursor? mouseCursor, bool toggleable, String? activeColor, @@ -459,7 +434,6 @@ class __$StacRadioCopyWithImpl<$Res> implements _$StacRadioCopyWith<$Res> { $Res call({ Object? radioType = null, Object? value = freezed, - Object? onChanged = freezed, Object? mouseCursor = freezed, Object? toggleable = null, Object? activeColor = freezed, @@ -484,10 +458,6 @@ class __$StacRadioCopyWithImpl<$Res> implements _$StacRadioCopyWith<$Res> { ? _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?, mouseCursor: freezed == mouseCursor ? _self.mouseCursor : mouseCursor // ignore: cast_nullable_to_non_nullable 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 index 88e1c7c3..2d13d16d 100644 --- 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 @@ -11,7 +11,6 @@ _StacRadio _$StacRadioFromJson(Map json) => _StacRadio( $enumDecodeNullable(_$StacRadioTypeEnumMap, json['radioType']) ?? StacRadioType.material, value: json['value'], - onChanged: json['onChanged'] as Map?, mouseCursor: $enumDecodeNullable(_$StacMouseCursorEnumMap, json['mouseCursor']), toggleable: json['toggleable'] as bool? ?? false, @@ -40,7 +39,6 @@ Map _$StacRadioToJson(_StacRadio instance) => { 'radioType': _$StacRadioTypeEnumMap[instance.radioType]!, 'value': instance.value, - 'onChanged': instance.onChanged, 'mouseCursor': _$StacMouseCursorEnumMap[instance.mouseCursor], 'toggleable': instance.toggleable, 'activeColor': instance.activeColor, diff --git a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio_parser.dart b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio_parser.dart index 8358877a..f5f021d9 100644 --- a/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio_parser.dart +++ b/packages/stac/lib/src/parsers/widgets/stac_radio/stac_radio_parser.dart @@ -47,13 +47,6 @@ class _RadioWidget extends StatelessWidget { } } - void _onChanged(dynamic value, BuildContext context) { - if (model.onChanged != null) { - Stac.onCallFromJson(model.onChanged, context); - } - radioGroupScope?.onSelect(value); - } - Widget _buildCupertinoRadio( BuildContext context, StacRadio model, @@ -64,10 +57,6 @@ class _RadioWidget extends StatelessWidget { builder: (context, value, child) { return CupertinoRadio( value: model.value, - groupValue: value, - onChanged: (dynamic value) { - _onChanged(value, context); - }, mouseCursor: model.mouseCursor?.value, toggleable: model.toggleable, activeColor: model.activeColor.toColor(context), @@ -92,10 +81,6 @@ class _RadioWidget extends StatelessWidget { builder: (context, value, child) { return Radio.adaptive( value: model.value, - groupValue: value, - onChanged: (dynamic value) { - _onChanged(value, context); - }, mouseCursor: model.mouseCursor?.value, toggleable: model.toggleable, activeColor: model.activeColor?.toColor(context), @@ -126,10 +111,6 @@ class _RadioWidget extends StatelessWidget { builder: (context, value, child) { return Radio( value: model.value, - groupValue: value, - onChanged: (dynamic value) { - _onChanged(value, context); - }, mouseCursor: model.mouseCursor?.value, toggleable: model.toggleable, activeColor: model.activeColor.toColor(context), 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 index e9c8c220..00754348 100644 --- a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.dart +++ b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch.dart @@ -18,7 +18,7 @@ abstract class StacSwitch with _$StacSwitch { @Default(false) value, Map? onChanged, @Default(false) bool autofocus, - String? activeColor, + String? activeThumbColor, String? activeTrackColor, String? focusColor, String? hoverColor, 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 index 268f6a1a..0914e61c 100644 --- 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 @@ -19,7 +19,7 @@ mixin _$StacSwitch { dynamic get value; Map? get onChanged; bool get autofocus; - String? get activeColor; + String? get activeThumbColor; String? get activeTrackColor; String? get focusColor; String? get hoverColor; @@ -62,8 +62,8 @@ mixin _$StacSwitch { const DeepCollectionEquality().equals(other.onChanged, onChanged) && (identical(other.autofocus, autofocus) || other.autofocus == autofocus) && - (identical(other.activeColor, activeColor) || - other.activeColor == activeColor) && + (identical(other.activeThumbColor, activeThumbColor) || + other.activeThumbColor == activeThumbColor) && (identical(other.activeTrackColor, activeTrackColor) || other.activeTrackColor == activeTrackColor) && (identical(other.focusColor, focusColor) || @@ -113,7 +113,7 @@ mixin _$StacSwitch { const DeepCollectionEquality().hash(value), const DeepCollectionEquality().hash(onChanged), autofocus, - activeColor, + activeThumbColor, activeTrackColor, focusColor, hoverColor, @@ -138,7 +138,7 @@ mixin _$StacSwitch { @override String toString() { - return 'StacSwitch(switchType: $switchType, value: $value, onChanged: $onChanged, autofocus: $autofocus, activeColor: $activeColor, 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)'; + 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)'; } } @@ -153,7 +153,7 @@ abstract mixin class $StacSwitchCopyWith<$Res> { dynamic value, Map? onChanged, bool autofocus, - String? activeColor, + String? activeThumbColor, String? activeTrackColor, String? focusColor, String? hoverColor, @@ -197,7 +197,7 @@ class _$StacSwitchCopyWithImpl<$Res> implements $StacSwitchCopyWith<$Res> { Object? value = freezed, Object? onChanged = freezed, Object? autofocus = null, - Object? activeColor = freezed, + Object? activeThumbColor = freezed, Object? activeTrackColor = freezed, Object? focusColor = freezed, Object? hoverColor = freezed, @@ -236,9 +236,9 @@ class _$StacSwitchCopyWithImpl<$Res> implements $StacSwitchCopyWith<$Res> { ? _self.autofocus : autofocus // ignore: cast_nullable_to_non_nullable as bool, - activeColor: freezed == activeColor - ? _self.activeColor - : activeColor // ignore: cast_nullable_to_non_nullable + activeThumbColor: freezed == activeThumbColor + ? _self.activeThumbColor + : activeThumbColor // ignore: cast_nullable_to_non_nullable as String?, activeTrackColor: freezed == activeTrackColor ? _self.activeTrackColor @@ -388,7 +388,7 @@ class _StacSwitch implements StacSwitch { this.value = false, final Map? onChanged, this.autofocus = false, - this.activeColor, + this.activeThumbColor, this.activeTrackColor, this.focusColor, this.hoverColor, @@ -434,7 +434,7 @@ class _StacSwitch implements StacSwitch { @JsonKey() final bool autofocus; @override - final String? activeColor; + final String? activeThumbColor; @override final String? activeTrackColor; @override @@ -512,8 +512,8 @@ class _StacSwitch implements StacSwitch { .equals(other._onChanged, _onChanged) && (identical(other.autofocus, autofocus) || other.autofocus == autofocus) && - (identical(other.activeColor, activeColor) || - other.activeColor == activeColor) && + (identical(other.activeThumbColor, activeThumbColor) || + other.activeThumbColor == activeThumbColor) && (identical(other.activeTrackColor, activeTrackColor) || other.activeTrackColor == activeTrackColor) && (identical(other.focusColor, focusColor) || @@ -564,7 +564,7 @@ class _StacSwitch implements StacSwitch { const DeepCollectionEquality().hash(value), const DeepCollectionEquality().hash(_onChanged), autofocus, - activeColor, + activeThumbColor, activeTrackColor, focusColor, hoverColor, @@ -589,7 +589,7 @@ class _StacSwitch implements StacSwitch { @override String toString() { - return 'StacSwitch(switchType: $switchType, value: $value, onChanged: $onChanged, autofocus: $autofocus, activeColor: $activeColor, 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)'; + 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)'; } } @@ -606,7 +606,7 @@ abstract mixin class _$StacSwitchCopyWith<$Res> dynamic value, Map? onChanged, bool autofocus, - String? activeColor, + String? activeThumbColor, String? activeTrackColor, String? focusColor, String? hoverColor, @@ -654,7 +654,7 @@ class __$StacSwitchCopyWithImpl<$Res> implements _$StacSwitchCopyWith<$Res> { Object? value = freezed, Object? onChanged = freezed, Object? autofocus = null, - Object? activeColor = freezed, + Object? activeThumbColor = freezed, Object? activeTrackColor = freezed, Object? focusColor = freezed, Object? hoverColor = freezed, @@ -693,9 +693,9 @@ class __$StacSwitchCopyWithImpl<$Res> implements _$StacSwitchCopyWith<$Res> { ? _self.autofocus : autofocus // ignore: cast_nullable_to_non_nullable as bool, - activeColor: freezed == activeColor - ? _self.activeColor - : activeColor // ignore: cast_nullable_to_non_nullable + activeThumbColor: freezed == activeThumbColor + ? _self.activeThumbColor + : activeThumbColor // ignore: cast_nullable_to_non_nullable as String?, activeTrackColor: freezed == activeTrackColor ? _self.activeTrackColor 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 index a70e5117..ca57d9f6 100644 --- 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 @@ -13,7 +13,7 @@ _StacSwitch _$StacSwitchFromJson(Map json) => _StacSwitch( value: json['value'] ?? false, onChanged: json['onChanged'] as Map?, autofocus: json['autofocus'] as bool? ?? false, - activeColor: json['activeColor'] as String?, + activeThumbColor: json['activeThumbColor'] as String?, activeTrackColor: json['activeTrackColor'] as String?, focusColor: json['focusColor'] as String?, hoverColor: json['hoverColor'] as String?, @@ -61,7 +61,7 @@ Map _$StacSwitchToJson(_StacSwitch instance) => 'value': instance.value, 'onChanged': instance.onChanged, 'autofocus': instance.autofocus, - 'activeColor': instance.activeColor, + 'activeThumbColor': instance.activeThumbColor, 'activeTrackColor': instance.activeTrackColor, 'focusColor': instance.focusColor, 'hoverColor': instance.hoverColor, diff --git a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart index 617f0928..2ae44b05 100644 --- a/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart +++ b/packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart @@ -80,7 +80,7 @@ class _SwitchWidgetState extends State<_SwitchWidget> { return CupertinoSwitch( value: isSelected, onChanged: _onChanged, - activeTrackColor: model.activeColor?.toColor(context), + activeTrackColor: model.activeThumbColor?.toColor(context), inactiveTrackColor: model.trackColor?.parse(context), thumbColor: model.thumbColor?.parse(context), applyTheme: model.applyTheme, @@ -96,7 +96,7 @@ class _SwitchWidgetState extends State<_SwitchWidget> { return Switch.adaptive( value: isSelected, onChanged: _onChanged, - activeColor: model.activeColor?.toColor(context), + activeThumbColor: model.activeThumbColor?.toColor(context), activeTrackColor: model.activeTrackColor?.toColor(context), inactiveThumbColor: model.inactiveThumbColor?.toColor(context), inactiveTrackColor: model.inactiveTrackColor?.toColor(context), @@ -133,7 +133,7 @@ class _SwitchWidgetState extends State<_SwitchWidget> { return Switch( value: isSelected, onChanged: _onChanged, - activeColor: model.activeColor.toColor(context), + activeThumbColor: model.activeThumbColor.toColor(context), activeTrackColor: model.activeTrackColor.toColor(context), inactiveThumbColor: model.inactiveThumbColor.toColor(context), inactiveTrackColor: model.inactiveTrackColor.toColor(context), diff --git a/packages/stac/pubspec.yaml b/packages/stac/pubspec.yaml index bb8c2672..67db2c60 100644 --- a/packages/stac/pubspec.yaml +++ b/packages/stac/pubspec.yaml @@ -1,11 +1,11 @@ name: stac description: Stac is a Server-Driven UI (SDUI) framework for Flutter. Stac allows you to build beautiful cross-platform applications with JSON in real time. -version: 1.0.0-dev.5 +version: 1.0.0-dev.6 homepage: https://github.com/StacDev/stac environment: sdk: ">=3.0.0 <4.0.0" - flutter: ">=1.17.0" + flutter: ">=3.35.0" topics: - ui diff --git a/website/docs/widgets/radio_group.md b/website/docs/widgets/radio_group.md index e10ed3b9..285531ae 100644 --- a/website/docs/widgets/radio_group.md +++ b/website/docs/widgets/radio_group.md @@ -17,7 +17,6 @@ To know more about the Radio widget in Flutter, refer to the [official documenta |----------------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------| | radioType | `StacRadioType` | The type of radio. | | value | `dynamic` | The value represented by this radio. | -| onChanged | `Map` | The action needs trigger when radio value change. | | mouseCursor | `StacMouseCursor` | The cursor for a mouse pointer when it enters or is hovering over the radio. | | toggleable | `bool` | Set to true if this wanted to deselect when selected. | | activeColor | `String` | The color to use when this radio button is selected. | diff --git a/website/docs/widgets/switch.md b/website/docs/widgets/switch.md index b0309be6..038527fb 100644 --- a/website/docs/widgets/switch.md +++ b/website/docs/widgets/switch.md @@ -11,7 +11,7 @@ To know more about the Switch widget in Flutter, refer to the [official document | value | `bool` | Whether this switch is on or off. | | onChanged | `Map` | Called when the user toggles the switch on or off. | | autofocus | `bool` | True if this widget will be selected as the initial focus when no other node in its scope is currently focused. | -| activeColor | `String` | The color to use when this switch is on. | +| activeThumbColor | `String` | The color to use when this switch is on. | | activeTrackColor | `String` | The color to use on the track when this switch is on. | | focusColor | `String` | The color for the button's when it has the input focus. | | hoverColor | `String` | The color for the button's when a pointer is hovering over it. |