From 1fd7f3cc2a0cfd6f2f5d1bb4cd3ac5478e2728f5 Mon Sep 17 00:00:00 2001 From: Oluwaseun Oyewale Date: Mon, 14 Apr 2025 14:07:31 +0100 Subject: [PATCH 1/2] fixed null when background is missing from ColorScheme --- .../stac_color_scheme/stac_color_scheme.dart | 2 +- .../stac_color_scheme.freezed.dart | 22 +++++++++---------- .../stac_color_scheme.g.dart | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart index f7c879a7..190977f9 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart @@ -25,7 +25,7 @@ abstract class StacColorScheme with _$StacColorScheme { required String onError, String? errorContainer, String? onErrorContainer, - required String background, + String? background, required String onBackground, required String surface, required String onSurface, diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart index 1e734fb0..48b49b1a 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart @@ -32,7 +32,7 @@ mixin _$StacColorScheme { String get onError; String? get errorContainer; String? get onErrorContainer; - String get background; + String? get background; String get onBackground; String get surface; String get onSurface; @@ -187,7 +187,7 @@ abstract mixin class $StacColorSchemeCopyWith<$Res> { String onError, String? errorContainer, String? onErrorContainer, - String background, + String? background, String onBackground, String surface, String onSurface, @@ -233,7 +233,7 @@ class _$StacColorSchemeCopyWithImpl<$Res> Object? onError = null, Object? errorContainer = freezed, Object? onErrorContainer = freezed, - Object? background = null, + Object? background = freezed, Object? onBackground = null, Object? surface = null, Object? onSurface = null, @@ -317,10 +317,10 @@ class _$StacColorSchemeCopyWithImpl<$Res> ? _self.onErrorContainer : onErrorContainer // ignore: cast_nullable_to_non_nullable as String?, - background: null == background + background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable - as String, + as String?, onBackground: null == onBackground ? _self.onBackground : onBackground // ignore: cast_nullable_to_non_nullable @@ -398,7 +398,7 @@ class _StacColorScheme implements StacColorScheme { required this.onError, this.errorContainer, this.onErrorContainer, - required this.background, + this.background, required this.onBackground, required this.surface, required this.onSurface, @@ -450,7 +450,7 @@ class _StacColorScheme implements StacColorScheme { @override final String? onErrorContainer; @override - final String background; + final String? background; @override final String onBackground; @override @@ -624,7 +624,7 @@ abstract mixin class _$StacColorSchemeCopyWith<$Res> String onError, String? errorContainer, String? onErrorContainer, - String background, + String? background, String onBackground, String surface, String onSurface, @@ -670,7 +670,7 @@ class __$StacColorSchemeCopyWithImpl<$Res> Object? onError = null, Object? errorContainer = freezed, Object? onErrorContainer = freezed, - Object? background = null, + Object? background = freezed, Object? onBackground = null, Object? surface = null, Object? onSurface = null, @@ -754,10 +754,10 @@ class __$StacColorSchemeCopyWithImpl<$Res> ? _self.onErrorContainer : onErrorContainer // ignore: cast_nullable_to_non_nullable as String?, - background: null == background + background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable - as String, + as String?, onBackground: null == onBackground ? _self.onBackground : onBackground // ignore: cast_nullable_to_non_nullable diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart index 9f69189b..92465463 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart @@ -25,7 +25,7 @@ _StacColorScheme _$StacColorSchemeFromJson(Map json) => onError: json['onError'] as String, errorContainer: json['errorContainer'] as String?, onErrorContainer: json['onErrorContainer'] as String?, - background: json['background'] as String, + background: json['background'] as String?, onBackground: json['onBackground'] as String, surface: json['surface'] as String, onSurface: json['onSurface'] as String, From 8e5defafb050aef14bc799e348989987c3e45908 Mon Sep 17 00:00:00 2001 From: Oluwaseun Oyewale Date: Mon, 14 Apr 2025 14:37:21 +0100 Subject: [PATCH 2/2] fixed null when onBackground is missing from ColorScheme --- .../stac_color_scheme/stac_color_scheme.dart | 2 +- .../stac_color_scheme.freezed.dart | 22 +++++++++---------- .../stac_color_scheme.g.dart | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart index 190977f9..1a037917 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.dart @@ -26,7 +26,7 @@ abstract class StacColorScheme with _$StacColorScheme { String? errorContainer, String? onErrorContainer, String? background, - required String onBackground, + String? onBackground, required String surface, required String onSurface, String? surfaceVariant, diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart index 48b49b1a..a46cbc9b 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.freezed.dart @@ -33,7 +33,7 @@ mixin _$StacColorScheme { String? get errorContainer; String? get onErrorContainer; String? get background; - String get onBackground; + String? get onBackground; String get surface; String get onSurface; String? get surfaceVariant; @@ -188,7 +188,7 @@ abstract mixin class $StacColorSchemeCopyWith<$Res> { String? errorContainer, String? onErrorContainer, String? background, - String onBackground, + String? onBackground, String surface, String onSurface, String? surfaceVariant, @@ -234,7 +234,7 @@ class _$StacColorSchemeCopyWithImpl<$Res> Object? errorContainer = freezed, Object? onErrorContainer = freezed, Object? background = freezed, - Object? onBackground = null, + Object? onBackground = freezed, Object? surface = null, Object? onSurface = null, Object? surfaceVariant = freezed, @@ -321,10 +321,10 @@ class _$StacColorSchemeCopyWithImpl<$Res> ? _self.background : background // ignore: cast_nullable_to_non_nullable as String?, - onBackground: null == onBackground + onBackground: freezed == onBackground ? _self.onBackground : onBackground // ignore: cast_nullable_to_non_nullable - as String, + as String?, surface: null == surface ? _self.surface : surface // ignore: cast_nullable_to_non_nullable @@ -399,7 +399,7 @@ class _StacColorScheme implements StacColorScheme { this.errorContainer, this.onErrorContainer, this.background, - required this.onBackground, + this.onBackground, required this.surface, required this.onSurface, this.surfaceVariant, @@ -452,7 +452,7 @@ class _StacColorScheme implements StacColorScheme { @override final String? background; @override - final String onBackground; + final String? onBackground; @override final String surface; @override @@ -625,7 +625,7 @@ abstract mixin class _$StacColorSchemeCopyWith<$Res> String? errorContainer, String? onErrorContainer, String? background, - String onBackground, + String? onBackground, String surface, String onSurface, String? surfaceVariant, @@ -671,7 +671,7 @@ class __$StacColorSchemeCopyWithImpl<$Res> Object? errorContainer = freezed, Object? onErrorContainer = freezed, Object? background = freezed, - Object? onBackground = null, + Object? onBackground = freezed, Object? surface = null, Object? onSurface = null, Object? surfaceVariant = freezed, @@ -758,10 +758,10 @@ class __$StacColorSchemeCopyWithImpl<$Res> ? _self.background : background // ignore: cast_nullable_to_non_nullable as String?, - onBackground: null == onBackground + onBackground: freezed == onBackground ? _self.onBackground : onBackground // ignore: cast_nullable_to_non_nullable - as String, + as String?, surface: null == surface ? _self.surface : surface // ignore: cast_nullable_to_non_nullable diff --git a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart index 92465463..54cd562a 100644 --- a/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart +++ b/packages/stac/lib/src/parsers/stac_color_scheme/stac_color_scheme.g.dart @@ -26,7 +26,7 @@ _StacColorScheme _$StacColorSchemeFromJson(Map json) => errorContainer: json['errorContainer'] as String?, onErrorContainer: json['onErrorContainer'] as String?, background: json['background'] as String?, - onBackground: json['onBackground'] as String, + onBackground: json['onBackground'] as String?, surface: json['surface'] as String, onSurface: json['onSurface'] as String, surfaceVariant: json['surfaceVariant'] as String?,