diff --git a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.dart b/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.dart deleted file mode 100644 index 6e4d1978..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.dart +++ /dev/null @@ -1,24 +0,0 @@ -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_linear_progress_indicator_parser.dart'; - -part 'stac_linear_progress_indicator.freezed.dart'; -part 'stac_linear_progress_indicator.g.dart'; - -@freezed -abstract class StacLinearProgressIndicator with _$StacLinearProgressIndicator { - const factory StacLinearProgressIndicator({ - StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - @Default(StacBorderRadius()) StacBorderRadius borderRadius, - }) = _StacLinearProgressIndicator; - - factory StacLinearProgressIndicator.fromJson(Map json) => - _$StacLinearProgressIndicatorFromJson(json); -} diff --git a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.freezed.dart b/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.freezed.dart deleted file mode 100644 index 148eac60..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.freezed.dart +++ /dev/null @@ -1,489 +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_linear_progress_indicator.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -// dart format off -T _$identity(T value) => value; - -/// @nodoc -mixin _$StacLinearProgressIndicator { - StacDouble? get value; - String? get backgroundColor; - String? get color; - StacDouble? get minHeight; - String? get semanticsLabel; - String? get semanticsValue; - StacBorderRadius get borderRadius; - - /// Create a copy of StacLinearProgressIndicator - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $StacLinearProgressIndicatorCopyWith - get copyWith => _$StacLinearProgressIndicatorCopyWithImpl< - StacLinearProgressIndicator>( - this as StacLinearProgressIndicator, _$identity); - - /// Serializes this StacLinearProgressIndicator to a JSON map. - Map toJson(); - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is StacLinearProgressIndicator && - (identical(other.value, value) || other.value == value) && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.color, color) || other.color == color) && - (identical(other.minHeight, minHeight) || - other.minHeight == minHeight) && - (identical(other.semanticsLabel, semanticsLabel) || - other.semanticsLabel == semanticsLabel) && - (identical(other.semanticsValue, semanticsValue) || - other.semanticsValue == semanticsValue) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, value, backgroundColor, color, - minHeight, semanticsLabel, semanticsValue, borderRadius); - - @override - String toString() { - return 'StacLinearProgressIndicator(value: $value, backgroundColor: $backgroundColor, color: $color, minHeight: $minHeight, semanticsLabel: $semanticsLabel, semanticsValue: $semanticsValue, borderRadius: $borderRadius)'; - } -} - -/// @nodoc -abstract mixin class $StacLinearProgressIndicatorCopyWith<$Res> { - factory $StacLinearProgressIndicatorCopyWith( - StacLinearProgressIndicator value, - $Res Function(StacLinearProgressIndicator) _then) = - _$StacLinearProgressIndicatorCopyWithImpl; - @useResult - $Res call( - {StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - StacBorderRadius borderRadius}); -} - -/// @nodoc -class _$StacLinearProgressIndicatorCopyWithImpl<$Res> - implements $StacLinearProgressIndicatorCopyWith<$Res> { - _$StacLinearProgressIndicatorCopyWithImpl(this._self, this._then); - - final StacLinearProgressIndicator _self; - final $Res Function(StacLinearProgressIndicator) _then; - - /// Create a copy of StacLinearProgressIndicator - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? value = freezed, - Object? backgroundColor = freezed, - Object? color = freezed, - Object? minHeight = freezed, - Object? semanticsLabel = freezed, - Object? semanticsValue = freezed, - Object? borderRadius = null, - }) { - return _then(_self.copyWith( - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as StacDouble?, - backgroundColor: freezed == backgroundColor - ? _self.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, - minHeight: freezed == minHeight - ? _self.minHeight - : minHeight // ignore: cast_nullable_to_non_nullable - as StacDouble?, - semanticsLabel: freezed == semanticsLabel - ? _self.semanticsLabel - : semanticsLabel // ignore: cast_nullable_to_non_nullable - as String?, - semanticsValue: freezed == semanticsValue - ? _self.semanticsValue - : semanticsValue // ignore: cast_nullable_to_non_nullable - as String?, - borderRadius: null == borderRadius - ? _self.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as StacBorderRadius, - )); - } -} - -/// Adds pattern-matching-related methods to [StacLinearProgressIndicator]. -extension StacLinearProgressIndicatorPatterns on StacLinearProgressIndicator { - /// 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(_StacLinearProgressIndicator value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator() 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(_StacLinearProgressIndicator value) $default, - ) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator(): - 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(_StacLinearProgressIndicator value)? $default, - ) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator() 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( - StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - StacBorderRadius borderRadius)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator() when $default != null: - return $default( - _that.value, - _that.backgroundColor, - _that.color, - _that.minHeight, - _that.semanticsLabel, - _that.semanticsValue, - _that.borderRadius); - 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( - StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - StacBorderRadius borderRadius) - $default, - ) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator(): - return $default( - _that.value, - _that.backgroundColor, - _that.color, - _that.minHeight, - _that.semanticsLabel, - _that.semanticsValue, - _that.borderRadius); - 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( - StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - StacBorderRadius borderRadius)? - $default, - ) { - final _that = this; - switch (_that) { - case _StacLinearProgressIndicator() when $default != null: - return $default( - _that.value, - _that.backgroundColor, - _that.color, - _that.minHeight, - _that.semanticsLabel, - _that.semanticsValue, - _that.borderRadius); - case _: - return null; - } - } -} - -/// @nodoc -@JsonSerializable() -class _StacLinearProgressIndicator implements StacLinearProgressIndicator { - const _StacLinearProgressIndicator( - {this.value, - this.backgroundColor, - this.color, - this.minHeight, - this.semanticsLabel, - this.semanticsValue, - this.borderRadius = const StacBorderRadius()}); - factory _StacLinearProgressIndicator.fromJson(Map json) => - _$StacLinearProgressIndicatorFromJson(json); - - @override - final StacDouble? value; - @override - final String? backgroundColor; - @override - final String? color; - @override - final StacDouble? minHeight; - @override - final String? semanticsLabel; - @override - final String? semanticsValue; - @override - @JsonKey() - final StacBorderRadius borderRadius; - - /// Create a copy of StacLinearProgressIndicator - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$StacLinearProgressIndicatorCopyWith<_StacLinearProgressIndicator> - get copyWith => __$StacLinearProgressIndicatorCopyWithImpl< - _StacLinearProgressIndicator>(this, _$identity); - - @override - Map toJson() { - return _$StacLinearProgressIndicatorToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _StacLinearProgressIndicator && - (identical(other.value, value) || other.value == value) && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.color, color) || other.color == color) && - (identical(other.minHeight, minHeight) || - other.minHeight == minHeight) && - (identical(other.semanticsLabel, semanticsLabel) || - other.semanticsLabel == semanticsLabel) && - (identical(other.semanticsValue, semanticsValue) || - other.semanticsValue == semanticsValue) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, value, backgroundColor, color, - minHeight, semanticsLabel, semanticsValue, borderRadius); - - @override - String toString() { - return 'StacLinearProgressIndicator(value: $value, backgroundColor: $backgroundColor, color: $color, minHeight: $minHeight, semanticsLabel: $semanticsLabel, semanticsValue: $semanticsValue, borderRadius: $borderRadius)'; - } -} - -/// @nodoc -abstract mixin class _$StacLinearProgressIndicatorCopyWith<$Res> - implements $StacLinearProgressIndicatorCopyWith<$Res> { - factory _$StacLinearProgressIndicatorCopyWith( - _StacLinearProgressIndicator value, - $Res Function(_StacLinearProgressIndicator) _then) = - __$StacLinearProgressIndicatorCopyWithImpl; - @override - @useResult - $Res call( - {StacDouble? value, - String? backgroundColor, - String? color, - StacDouble? minHeight, - String? semanticsLabel, - String? semanticsValue, - StacBorderRadius borderRadius}); -} - -/// @nodoc -class __$StacLinearProgressIndicatorCopyWithImpl<$Res> - implements _$StacLinearProgressIndicatorCopyWith<$Res> { - __$StacLinearProgressIndicatorCopyWithImpl(this._self, this._then); - - final _StacLinearProgressIndicator _self; - final $Res Function(_StacLinearProgressIndicator) _then; - - /// Create a copy of StacLinearProgressIndicator - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? value = freezed, - Object? backgroundColor = freezed, - Object? color = freezed, - Object? minHeight = freezed, - Object? semanticsLabel = freezed, - Object? semanticsValue = freezed, - Object? borderRadius = null, - }) { - return _then(_StacLinearProgressIndicator( - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as StacDouble?, - backgroundColor: freezed == backgroundColor - ? _self.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - color: freezed == color - ? _self.color - : color // ignore: cast_nullable_to_non_nullable - as String?, - minHeight: freezed == minHeight - ? _self.minHeight - : minHeight // ignore: cast_nullable_to_non_nullable - as StacDouble?, - semanticsLabel: freezed == semanticsLabel - ? _self.semanticsLabel - : semanticsLabel // ignore: cast_nullable_to_non_nullable - as String?, - semanticsValue: freezed == semanticsValue - ? _self.semanticsValue - : semanticsValue // ignore: cast_nullable_to_non_nullable - as String?, - borderRadius: null == borderRadius - ? _self.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as StacBorderRadius, - )); - } -} - -// dart format on diff --git a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.g.dart b/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.g.dart deleted file mode 100644 index 7de071a2..00000000 --- a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'stac_linear_progress_indicator.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_StacLinearProgressIndicator _$StacLinearProgressIndicatorFromJson( - Map json) => - _StacLinearProgressIndicator( - value: json['value'] == null ? null : StacDouble.fromJson(json['value']), - backgroundColor: json['backgroundColor'] as String?, - color: json['color'] as String?, - minHeight: json['minHeight'] == null - ? null - : StacDouble.fromJson(json['minHeight']), - semanticsLabel: json['semanticsLabel'] as String?, - semanticsValue: json['semanticsValue'] as String?, - borderRadius: json['borderRadius'] == null - ? const StacBorderRadius() - : StacBorderRadius.fromJson(json['borderRadius']), - ); - -Map _$StacLinearProgressIndicatorToJson( - _StacLinearProgressIndicator instance) => - { - 'value': instance.value, - 'backgroundColor': instance.backgroundColor, - 'color': instance.color, - 'minHeight': instance.minHeight, - 'semanticsLabel': instance.semanticsLabel, - 'semanticsValue': instance.semanticsValue, - 'borderRadius': instance.borderRadius, - }; diff --git a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart b/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart index b570d2e0..d84d2b30 100644 --- a/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart +++ b/packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:stac/src/parsers/foundation/borders/stac_border_radius_parser.dart'; -import 'package:stac/src/parsers/widgets/stac_double/stac_double.dart'; import 'package:stac/stac.dart'; import 'package:stac_core/stac_core.dart'; @@ -18,13 +17,13 @@ class StacLinearProgressIndicatorParser @override Widget parse(BuildContext context, StacLinearProgressIndicator model) { return LinearProgressIndicator( - value: model.value?.parse, - backgroundColor: model.backgroundColor.toColor(context), - color: model.color.toColor(context), - minHeight: model.minHeight?.parse, + value: model.value, + backgroundColor: model.backgroundColor?.toColor(context), + color: model.color?.toColor(context), + minHeight: model.minHeight, semanticsLabel: model.semanticsLabel, semanticsValue: model.semanticsValue, - borderRadius: model.borderRadius.parse, + borderRadius: model.borderRadius?.parse, ); } } diff --git a/packages/stac/lib/src/parsers/widgets/widgets.dart b/packages/stac/lib/src/parsers/widgets/widgets.dart index 8fdbc499..f1753563 100644 --- a/packages/stac/lib/src/parsers/widgets/widgets.dart +++ b/packages/stac/lib/src/parsers/widgets/widgets.dart @@ -44,7 +44,7 @@ export 'package:stac/src/parsers/widgets/stac_icon/stac_icon_parser.dart'; export 'package:stac/src/parsers/widgets/stac_icon_button/stac_icon_button_parser.dart'; export 'package:stac/src/parsers/widgets/stac_image/stac_image_parser.dart'; export 'package:stac/src/parsers/widgets/stac_limited_box/stac_limited_box_parser.dart'; -export 'package:stac/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator.dart'; +export 'package:stac/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart'; export 'package:stac/src/parsers/widgets/stac_list_tile/stac_list_tile_parser.dart'; export 'package:stac/src/parsers/widgets/stac_list_view/stac_list_view_parser.dart'; export 'package:stac/src/parsers/widgets/stac_network_widget/stac_network_widget_parser.dart'; diff --git a/packages/stac_core/lib/widgets/align/stac_align.g.dart b/packages/stac_core/lib/widgets/align/stac_align.g.dart index c3587726..fca650d8 100644 --- a/packages/stac_core/lib/widgets/align/stac_align.g.dart +++ b/packages/stac_core/lib/widgets/align/stac_align.g.dart @@ -7,12 +7,10 @@ part of 'stac_align.dart'; // ************************************************************************** StacAlign _$StacAlignFromJson(Map json) => StacAlign( - alignment: - $enumDecodeNullable( - _$StacAlignmentDirectionalEnumMap, - json['alignment'], - ) ?? - StacAlignmentDirectional.center, + alignment: $enumDecodeNullable( + _$StacAlignmentDirectionalEnumMap, + json['alignment'], + ), widthFactor: const DoubleConverter().fromJson(json['widthFactor']), heightFactor: const DoubleConverter().fromJson(json['heightFactor']), child: json['child'] == null @@ -21,7 +19,7 @@ StacAlign _$StacAlignFromJson(Map json) => StacAlign( ); Map _$StacAlignToJson(StacAlign instance) => { - 'alignment': _$StacAlignmentDirectionalEnumMap[instance.alignment]!, + 'alignment': _$StacAlignmentDirectionalEnumMap[instance.alignment], 'widthFactor': const DoubleConverter().toJson(instance.widthFactor), 'heightFactor': const DoubleConverter().toJson(instance.heightFactor), 'child': instance.child?.toJson(), diff --git a/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.dart b/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.dart new file mode 100644 index 00000000..7040c926 --- /dev/null +++ b/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.dart @@ -0,0 +1,92 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:stac_core/core/converters/double_converter.dart'; +import 'package:stac_core/core/stac_widget.dart'; +import 'package:stac_core/foundation/foundation.dart'; + +part 'stac_linear_progress_indicator.g.dart'; + +/// A Stac model representing Flutter's [LinearProgressIndicator] widget. +/// +/// Displays a linear progress indicator. Can be determinate when [value] is +/// provided (0.0 to 1.0), or indeterminate when [value] is null. +/// +/// {@tool snippet} +/// Dart Example: +/// ```dart +/// StacLinearProgressIndicator( +/// value: 0.5, +/// color: StacColors.blue, +/// minHeight: 4.0, +/// ) +/// ``` +/// {@end-tool} +/// +/// {@tool snippet} +/// JSON Example: +/// ```json +/// { +/// "type": "linearProgressIndicator", +/// "value": 0.5, +/// "color": "#2196F3", +/// "minHeight": 4.0 +/// } +/// ``` +/// {@end-tool} +/// +/// See also: +/// * Flutter's LinearProgressIndicator documentation (`https://api.flutter.dev/flutter/material/LinearProgressIndicator-class.html`) +@JsonSerializable() +class StacLinearProgressIndicator extends StacWidget { + /// Creates a [StacLinearProgressIndicator] widget. + /// + /// All parameters are optional. When [value] is provided (0.0 to 1.0), + /// the progress indicator is determinate. When [value] is null, it's + /// indeterminate and will animate continuously. + /// + /// The [backgroundColor] sets the track color, [color] sets the progress + /// color, and [minHeight] controls the minimum height of the indicator. + const StacLinearProgressIndicator({ + this.value, + this.backgroundColor, + this.color, + this.minHeight, + this.semanticsLabel, + this.semanticsValue, + this.borderRadius, + }); + + /// Progress value from 0.0 to 1.0 for determinate mode; null for indeterminate. + @DoubleConverter() + final double? value; + + /// Background color of the linear track. + final StacColor? backgroundColor; + + /// Foreground color of the progress indicator. + final StacColor? color; + + /// Minimum height of the progress indicator. + @DoubleConverter() + final double? minHeight; + + /// Semantics label for accessibility. + final String? semanticsLabel; + + /// Semantics value for accessibility. + final String? semanticsValue; + + /// Border radius of the progress indicator. + final StacBorderRadius? borderRadius; + + /// Widget type identifier. + @override + String get type => WidgetType.linearProgressIndicator.name; + + /// Creates a [StacLinearProgressIndicator] from a JSON map. + factory StacLinearProgressIndicator.fromJson(Map json) => + _$StacLinearProgressIndicatorFromJson(json); + + /// Converts this [StacLinearProgressIndicator] instance to a JSON map. + @override + Map toJson() => _$StacLinearProgressIndicatorToJson(this); +} diff --git a/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.g.dart b/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.g.dart new file mode 100644 index 00000000..fe30d92f --- /dev/null +++ b/packages/stac_core/lib/widgets/linear_progress_indicator/stac_linear_progress_indicator.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'stac_linear_progress_indicator.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StacLinearProgressIndicator _$StacLinearProgressIndicatorFromJson( + Map json, +) => StacLinearProgressIndicator( + value: const DoubleConverter().fromJson(json['value']), + backgroundColor: json['backgroundColor'] as String?, + color: json['color'] as String?, + minHeight: const DoubleConverter().fromJson(json['minHeight']), + semanticsLabel: json['semanticsLabel'] as String?, + semanticsValue: json['semanticsValue'] as String?, + borderRadius: json['borderRadius'] == null + ? null + : StacBorderRadius.fromJson(json['borderRadius']), +); + +Map _$StacLinearProgressIndicatorToJson( + StacLinearProgressIndicator instance, +) => { + 'value': const DoubleConverter().toJson(instance.value), + 'backgroundColor': instance.backgroundColor, + 'color': instance.color, + 'minHeight': const DoubleConverter().toJson(instance.minHeight), + 'semanticsLabel': instance.semanticsLabel, + 'semanticsValue': instance.semanticsValue, + 'borderRadius': instance.borderRadius?.toJson(), + 'type': instance.type, +}; diff --git a/packages/stac_core/lib/widgets/widgets.dart b/packages/stac_core/lib/widgets/widgets.dart index f1b64f27..b130c607 100644 --- a/packages/stac_core/lib/widgets/widgets.dart +++ b/packages/stac_core/lib/widgets/widgets.dart @@ -35,6 +35,7 @@ export 'flexible/stac_flexible.dart'; export 'floating_action_button/stac_floating_action_button.dart'; export 'form/stac_form.dart'; export 'fractionally_sized_box/stac_fractionally_sized_box.dart'; +export 'gesture_detector/stac_gesture_detector.dart'; export 'grid_view/stac_grid_view.dart'; export 'hero/stac_hero.dart'; export 'icon/stac_icon.dart'; @@ -43,6 +44,9 @@ export 'icon_button/stac_icon_button.dart'; export 'image/stac_image.dart'; export 'ink_well/stac_ink_well.dart'; export 'limited_box/stac_limited_box.dart'; +export 'linear_progress_indicator/stac_linear_progress_indicator.dart'; +export 'list_tile/stac_list_tile.dart'; +export 'list_view/stac_list_view.dart'; export 'network_widget/stac_network_widget.dart'; export 'opacity/stac_opacity.dart'; export 'outlined_button/stac_outlined_button.dart'; @@ -76,6 +80,3 @@ export 'text_form_field/stac_text_form_field.dart'; export 'vertical_divider/stac_vertical_divider.dart'; export 'visibility/stac_visibility.dart'; export 'wrap/stac_wrap.dart'; -export 'list_view/stac_list_view.dart'; -export 'list_tile/stac_list_tile.dart'; -export 'gesture_detector/stac_gesture_detector.dart';