diff --git a/examples/mirai_gallery/pubspec.lock b/examples/mirai_gallery/pubspec.lock index f13a4d84..373174eb 100644 --- a/examples/mirai_gallery/pubspec.lock +++ b/examples/mirai_gallery/pubspec.lock @@ -149,10 +149,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -375,10 +375,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -521,18 +521,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -561,10 +561,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" timing: dependency: transitive description: @@ -601,10 +601,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -654,5 +654,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.7.0" diff --git a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.dart b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.dart index 18cb3c6d..41dbb23e 100644 --- a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.dart +++ b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.dart @@ -30,6 +30,7 @@ class MiraiTabBar with _$MiraiTabBar { @Default(DragStartBehavior.start) DragStartBehavior dragStartBehavior, bool? enableFeedback, MiraiScrollPhysics? physics, + TabAlignment? tabAlignment, }) = _MiraiTabBar; factory MiraiTabBar.fromJson(Map json) => diff --git a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.freezed.dart b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.freezed.dart index 67a94592..f70b1a90 100644 --- a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.freezed.dart +++ b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.freezed.dart @@ -39,6 +39,7 @@ mixin _$MiraiTabBar { DragStartBehavior get dragStartBehavior => throw _privateConstructorUsedError; bool? get enableFeedback => throw _privateConstructorUsedError; MiraiScrollPhysics? get physics => throw _privateConstructorUsedError; + TabAlignment? get tabAlignment => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -69,7 +70,8 @@ abstract class $MiraiTabBarCopyWith<$Res> { MiraiTextStyle? unselectedLabelStyle, DragStartBehavior dragStartBehavior, bool? enableFeedback, - MiraiScrollPhysics? physics}); + MiraiScrollPhysics? physics, + TabAlignment? tabAlignment}); $MiraiEdgeInsetsCopyWith<$Res>? get padding; $MiraiEdgeInsetsCopyWith<$Res>? get indicatorPadding; @@ -108,6 +110,7 @@ class _$MiraiTabBarCopyWithImpl<$Res, $Val extends MiraiTabBar> Object? dragStartBehavior = null, Object? enableFeedback = freezed, Object? physics = freezed, + Object? tabAlignment = freezed, }) { return _then(_value.copyWith( tabs: null == tabs @@ -179,6 +182,10 @@ class _$MiraiTabBarCopyWithImpl<$Res, $Val extends MiraiTabBar> ? _value.physics : physics // ignore: cast_nullable_to_non_nullable as MiraiScrollPhysics?, + tabAlignment: freezed == tabAlignment + ? _value.tabAlignment + : tabAlignment // ignore: cast_nullable_to_non_nullable + as TabAlignment?, ) as $Val); } @@ -244,11 +251,11 @@ class _$MiraiTabBarCopyWithImpl<$Res, $Val extends MiraiTabBar> } /// @nodoc -abstract class _$$_MiraiTabBarCopyWith<$Res> +abstract class _$$MiraiTabBarImplCopyWith<$Res> implements $MiraiTabBarCopyWith<$Res> { - factory _$$_MiraiTabBarCopyWith( - _$_MiraiTabBar value, $Res Function(_$_MiraiTabBar) then) = - __$$_MiraiTabBarCopyWithImpl<$Res>; + factory _$$MiraiTabBarImplCopyWith( + _$MiraiTabBarImpl value, $Res Function(_$MiraiTabBarImpl) then) = + __$$MiraiTabBarImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -268,7 +275,8 @@ abstract class _$$_MiraiTabBarCopyWith<$Res> MiraiTextStyle? unselectedLabelStyle, DragStartBehavior dragStartBehavior, bool? enableFeedback, - MiraiScrollPhysics? physics}); + MiraiScrollPhysics? physics, + TabAlignment? tabAlignment}); @override $MiraiEdgeInsetsCopyWith<$Res>? get padding; @@ -283,11 +291,11 @@ abstract class _$$_MiraiTabBarCopyWith<$Res> } /// @nodoc -class __$$_MiraiTabBarCopyWithImpl<$Res> - extends _$MiraiTabBarCopyWithImpl<$Res, _$_MiraiTabBar> - implements _$$_MiraiTabBarCopyWith<$Res> { - __$$_MiraiTabBarCopyWithImpl( - _$_MiraiTabBar _value, $Res Function(_$_MiraiTabBar) _then) +class __$$MiraiTabBarImplCopyWithImpl<$Res> + extends _$MiraiTabBarCopyWithImpl<$Res, _$MiraiTabBarImpl> + implements _$$MiraiTabBarImplCopyWith<$Res> { + __$$MiraiTabBarImplCopyWithImpl( + _$MiraiTabBarImpl _value, $Res Function(_$MiraiTabBarImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -310,8 +318,9 @@ class __$$_MiraiTabBarCopyWithImpl<$Res> Object? dragStartBehavior = null, Object? enableFeedback = freezed, Object? physics = freezed, + Object? tabAlignment = freezed, }) { - return _then(_$_MiraiTabBar( + return _then(_$MiraiTabBarImpl( tabs: null == tabs ? _value._tabs : tabs // ignore: cast_nullable_to_non_nullable @@ -381,14 +390,18 @@ class __$$_MiraiTabBarCopyWithImpl<$Res> ? _value.physics : physics // ignore: cast_nullable_to_non_nullable as MiraiScrollPhysics?, + tabAlignment: freezed == tabAlignment + ? _value.tabAlignment + : tabAlignment // ignore: cast_nullable_to_non_nullable + as TabAlignment?, )); } } /// @nodoc @JsonSerializable() -class _$_MiraiTabBar implements _MiraiTabBar { - const _$_MiraiTabBar( +class _$MiraiTabBarImpl implements _MiraiTabBar { + const _$MiraiTabBarImpl( {required final List> tabs, this.initialIndex = 0, this.isScrollable = false, @@ -405,11 +418,12 @@ class _$_MiraiTabBar implements _MiraiTabBar { this.unselectedLabelStyle, this.dragStartBehavior = DragStartBehavior.start, this.enableFeedback, - this.physics}) + this.physics, + this.tabAlignment}) : _tabs = tabs; - factory _$_MiraiTabBar.fromJson(Map json) => - _$$_MiraiTabBarFromJson(json); + factory _$MiraiTabBarImpl.fromJson(Map json) => + _$$MiraiTabBarImplFromJson(json); final List> _tabs; @override @@ -456,17 +470,19 @@ class _$_MiraiTabBar implements _MiraiTabBar { final bool? enableFeedback; @override final MiraiScrollPhysics? physics; + @override + final TabAlignment? tabAlignment; @override String toString() { - return 'MiraiTabBar(tabs: $tabs, initialIndex: $initialIndex, isScrollable: $isScrollable, padding: $padding, indicatorColor: $indicatorColor, automaticIndicatorColorAdjustment: $automaticIndicatorColorAdjustment, indicatorWeight: $indicatorWeight, indicatorPadding: $indicatorPadding, indicatorSize: $indicatorSize, labelColor: $labelColor, labelStyle: $labelStyle, labelPadding: $labelPadding, unselectedLabelColor: $unselectedLabelColor, unselectedLabelStyle: $unselectedLabelStyle, dragStartBehavior: $dragStartBehavior, enableFeedback: $enableFeedback, physics: $physics)'; + return 'MiraiTabBar(tabs: $tabs, initialIndex: $initialIndex, isScrollable: $isScrollable, padding: $padding, indicatorColor: $indicatorColor, automaticIndicatorColorAdjustment: $automaticIndicatorColorAdjustment, indicatorWeight: $indicatorWeight, indicatorPadding: $indicatorPadding, indicatorSize: $indicatorSize, labelColor: $labelColor, labelStyle: $labelStyle, labelPadding: $labelPadding, unselectedLabelColor: $unselectedLabelColor, unselectedLabelStyle: $unselectedLabelStyle, dragStartBehavior: $dragStartBehavior, enableFeedback: $enableFeedback, physics: $physics, tabAlignment: $tabAlignment)'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_MiraiTabBar && + other is _$MiraiTabBarImpl && const DeepCollectionEquality().equals(other._tabs, _tabs) && (identical(other.initialIndex, initialIndex) || other.initialIndex == initialIndex) && @@ -499,7 +515,9 @@ class _$_MiraiTabBar implements _MiraiTabBar { other.dragStartBehavior == dragStartBehavior) && (identical(other.enableFeedback, enableFeedback) || other.enableFeedback == enableFeedback) && - (identical(other.physics, physics) || other.physics == physics)); + (identical(other.physics, physics) || other.physics == physics) && + (identical(other.tabAlignment, tabAlignment) || + other.tabAlignment == tabAlignment)); } @JsonKey(ignore: true) @@ -522,17 +540,18 @@ class _$_MiraiTabBar implements _MiraiTabBar { unselectedLabelStyle, dragStartBehavior, enableFeedback, - physics); + physics, + tabAlignment); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_MiraiTabBarCopyWith<_$_MiraiTabBar> get copyWith => - __$$_MiraiTabBarCopyWithImpl<_$_MiraiTabBar>(this, _$identity); + _$$MiraiTabBarImplCopyWith<_$MiraiTabBarImpl> get copyWith => + __$$MiraiTabBarImplCopyWithImpl<_$MiraiTabBarImpl>(this, _$identity); @override Map toJson() { - return _$$_MiraiTabBarToJson( + return _$$MiraiTabBarImplToJson( this, ); } @@ -556,10 +575,11 @@ abstract class _MiraiTabBar implements MiraiTabBar { final MiraiTextStyle? unselectedLabelStyle, final DragStartBehavior dragStartBehavior, final bool? enableFeedback, - final MiraiScrollPhysics? physics}) = _$_MiraiTabBar; + final MiraiScrollPhysics? physics, + final TabAlignment? tabAlignment}) = _$MiraiTabBarImpl; factory _MiraiTabBar.fromJson(Map json) = - _$_MiraiTabBar.fromJson; + _$MiraiTabBarImpl.fromJson; @override List> get tabs; @@ -596,7 +616,9 @@ abstract class _MiraiTabBar implements MiraiTabBar { @override MiraiScrollPhysics? get physics; @override + TabAlignment? get tabAlignment; + @override @JsonKey(ignore: true) - _$$_MiraiTabBarCopyWith<_$_MiraiTabBar> get copyWith => + _$$MiraiTabBarImplCopyWith<_$MiraiTabBarImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.g.dart b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.g.dart index 6e1a0a05..2bb48464 100644 --- a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.g.dart +++ b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar.g.dart @@ -6,8 +6,8 @@ part of 'mirai_tab_bar.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_MiraiTabBar _$$_MiraiTabBarFromJson(Map json) => - _$_MiraiTabBar( +_$MiraiTabBarImpl _$$MiraiTabBarImplFromJson(Map json) => + _$MiraiTabBarImpl( tabs: (json['tabs'] as List) .map((e) => e as Map) .toList(), @@ -45,9 +45,11 @@ _$_MiraiTabBar _$$_MiraiTabBarFromJson(Map json) => enableFeedback: json['enableFeedback'] as bool?, physics: $enumDecodeNullable(_$MiraiScrollPhysicsEnumMap, json['physics']), + tabAlignment: + $enumDecodeNullable(_$TabAlignmentEnumMap, json['tabAlignment']), ); -Map _$$_MiraiTabBarToJson(_$_MiraiTabBar instance) => +Map _$$MiraiTabBarImplToJson(_$MiraiTabBarImpl instance) => { 'tabs': instance.tabs, 'initialIndex': instance.initialIndex, @@ -68,6 +70,7 @@ Map _$$_MiraiTabBarToJson(_$_MiraiTabBar instance) => _$DragStartBehaviorEnumMap[instance.dragStartBehavior]!, 'enableFeedback': instance.enableFeedback, 'physics': _$MiraiScrollPhysicsEnumMap[instance.physics], + 'tabAlignment': _$TabAlignmentEnumMap[instance.tabAlignment], }; const _$TabBarIndicatorSizeEnumMap = { @@ -87,3 +90,10 @@ const _$MiraiScrollPhysicsEnumMap = { MiraiScrollPhysics.fixed: 'fixed', MiraiScrollPhysics.page: 'page', }; + +const _$TabAlignmentEnumMap = { + TabAlignment.start: 'start', + TabAlignment.startOffset: 'startOffset', + TabAlignment.fill: 'fill', + TabAlignment.center: 'center', +}; diff --git a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar_parser.dart b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar_parser.dart index 40827793..2c00ded6 100644 --- a/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar_parser.dart +++ b/packages/mirai/lib/src/parsers/mirai_tab_bar/mirai_tab_bar_parser.dart @@ -42,6 +42,7 @@ class MiraiTabBarParser extends MiraiParser { enableFeedback: model.enableFeedback, onTap: (_) {}, physics: model.physics?.parse, + tabAlignment: model.tabAlignment, ); } }