diff --git a/lib/models/wallet.dart b/lib/models/wallet.dart index df866ca..505d84a 100644 --- a/lib/models/wallet.dart +++ b/lib/models/wallet.dart @@ -56,3 +56,32 @@ sealed class SnTransaction with _$SnTransaction { factory SnTransaction.fromJson(Map<String, dynamic> json) => _$SnTransactionFromJson(json); } + +@freezed +sealed class SnWalletSubscription with _$SnWalletSubscription { + const factory SnWalletSubscription({ + required String id, + required DateTime begunAt, + required DateTime endedAt, + required String identifier, + required bool isActive, + required bool isFreeTrial, + required int status, + required String paymentMethod, + required Map<String, dynamic> paymentDetails, + required double basePrice, + required String? couponId, + required dynamic coupon, + required DateTime renewalAt, + required String accountId, + required SnAccount? account, + required bool isAvailable, + required double finalPrice, + required DateTime createdAt, + required DateTime updatedAt, + required DateTime? deletedAt, + }) = _SnWalletSubscription; + + factory SnWalletSubscription.fromJson(Map<String, dynamic> json) => + _$SnWalletSubscriptionFromJson(json); +} diff --git a/lib/models/wallet.freezed.dart b/lib/models/wallet.freezed.dart index 466aaea..71415d7 100644 --- a/lib/models/wallet.freezed.dart +++ b/lib/models/wallet.freezed.dart @@ -558,4 +558,224 @@ $SnWalletCopyWith<$Res>? get payeeWallet { } } + +/// @nodoc +mixin _$SnWalletSubscription { + + String get id; DateTime get begunAt; DateTime get endedAt; String get identifier; bool get isActive; bool get isFreeTrial; int get status; String get paymentMethod; Map<String, dynamic> get paymentDetails; double get basePrice; String? get couponId; dynamic get coupon; DateTime get renewalAt; String get accountId; SnAccount? get account; bool get isAvailable; double get finalPrice; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SnWalletSubscriptionCopyWith<SnWalletSubscription> get copyWith => _$SnWalletSubscriptionCopyWithImpl<SnWalletSubscription>(this as SnWalletSubscription, _$identity); + + /// Serializes this SnWalletSubscription to a JSON map. + Map<String, dynamic> toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SnWalletSubscription&&(identical(other.id, id) || other.id == id)&&(identical(other.begunAt, begunAt) || other.begunAt == begunAt)&&(identical(other.endedAt, endedAt) || other.endedAt == endedAt)&&(identical(other.identifier, identifier) || other.identifier == identifier)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.isFreeTrial, isFreeTrial) || other.isFreeTrial == isFreeTrial)&&(identical(other.status, status) || other.status == status)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other.paymentDetails, paymentDetails)&&(identical(other.basePrice, basePrice) || other.basePrice == basePrice)&&(identical(other.couponId, couponId) || other.couponId == couponId)&&const DeepCollectionEquality().equals(other.coupon, coupon)&&(identical(other.renewalAt, renewalAt) || other.renewalAt == renewalAt)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.isAvailable, isAvailable) || other.isAvailable == isAvailable)&&(identical(other.finalPrice, finalPrice) || other.finalPrice == finalPrice)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,begunAt,endedAt,identifier,isActive,isFreeTrial,status,paymentMethod,const DeepCollectionEquality().hash(paymentDetails),basePrice,couponId,const DeepCollectionEquality().hash(coupon),renewalAt,accountId,account,isAvailable,finalPrice,createdAt,updatedAt,deletedAt]); + +@override +String toString() { + return 'SnWalletSubscription(id: $id, begunAt: $begunAt, endedAt: $endedAt, identifier: $identifier, isActive: $isActive, isFreeTrial: $isFreeTrial, status: $status, paymentMethod: $paymentMethod, paymentDetails: $paymentDetails, basePrice: $basePrice, couponId: $couponId, coupon: $coupon, renewalAt: $renewalAt, accountId: $accountId, account: $account, isAvailable: $isAvailable, finalPrice: $finalPrice, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)'; +} + + +} + +/// @nodoc +abstract mixin class $SnWalletSubscriptionCopyWith<$Res> { + factory $SnWalletSubscriptionCopyWith(SnWalletSubscription value, $Res Function(SnWalletSubscription) _then) = _$SnWalletSubscriptionCopyWithImpl; +@useResult +$Res call({ + String id, DateTime begunAt, DateTime endedAt, String identifier, bool isActive, bool isFreeTrial, int status, String paymentMethod, Map<String, dynamic> paymentDetails, double basePrice, String? couponId, dynamic coupon, DateTime renewalAt, String accountId, SnAccount? account, bool isAvailable, double finalPrice, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt +}); + + +$SnAccountCopyWith<$Res>? get account; + +} +/// @nodoc +class _$SnWalletSubscriptionCopyWithImpl<$Res> + implements $SnWalletSubscriptionCopyWith<$Res> { + _$SnWalletSubscriptionCopyWithImpl(this._self, this._then); + + final SnWalletSubscription _self; + final $Res Function(SnWalletSubscription) _then; + +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? begunAt = null,Object? endedAt = null,Object? identifier = null,Object? isActive = null,Object? isFreeTrial = null,Object? status = null,Object? paymentMethod = null,Object? paymentDetails = null,Object? basePrice = null,Object? couponId = freezed,Object? coupon = freezed,Object? renewalAt = null,Object? accountId = null,Object? account = freezed,Object? isAvailable = null,Object? finalPrice = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,begunAt: null == begunAt ? _self.begunAt : begunAt // ignore: cast_nullable_to_non_nullable +as DateTime,endedAt: null == endedAt ? _self.endedAt : endedAt // ignore: cast_nullable_to_non_nullable +as DateTime,identifier: null == identifier ? _self.identifier : identifier // ignore: cast_nullable_to_non_nullable +as String,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool,isFreeTrial: null == isFreeTrial ? _self.isFreeTrial : isFreeTrial // ignore: cast_nullable_to_non_nullable +as bool,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as int,paymentMethod: null == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String,paymentDetails: null == paymentDetails ? _self.paymentDetails : paymentDetails // ignore: cast_nullable_to_non_nullable +as Map<String, dynamic>,basePrice: null == basePrice ? _self.basePrice : basePrice // ignore: cast_nullable_to_non_nullable +as double,couponId: freezed == couponId ? _self.couponId : couponId // ignore: cast_nullable_to_non_nullable +as String?,coupon: freezed == coupon ? _self.coupon : coupon // ignore: cast_nullable_to_non_nullable +as dynamic,renewalAt: null == renewalAt ? _self.renewalAt : renewalAt // ignore: cast_nullable_to_non_nullable +as DateTime,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as SnAccount?,isAvailable: null == isAvailable ? _self.isAvailable : isAvailable // ignore: cast_nullable_to_non_nullable +as bool,finalPrice: null == finalPrice ? _self.finalPrice : finalPrice // ignore: cast_nullable_to_non_nullable +as double,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable +as DateTime?, + )); +} +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnAccountCopyWith<$Res>? get account { + if (_self.account == null) { + return null; + } + + return $SnAccountCopyWith<$Res>(_self.account!, (value) { + return _then(_self.copyWith(account: value)); + }); +} +} + + +/// @nodoc +@JsonSerializable() + +class _SnWalletSubscription implements SnWalletSubscription { + const _SnWalletSubscription({required this.id, required this.begunAt, required this.endedAt, required this.identifier, required this.isActive, required this.isFreeTrial, required this.status, required this.paymentMethod, required final Map<String, dynamic> paymentDetails, required this.basePrice, required this.couponId, required this.coupon, required this.renewalAt, required this.accountId, required this.account, required this.isAvailable, required this.finalPrice, required this.createdAt, required this.updatedAt, required this.deletedAt}): _paymentDetails = paymentDetails; + factory _SnWalletSubscription.fromJson(Map<String, dynamic> json) => _$SnWalletSubscriptionFromJson(json); + +@override final String id; +@override final DateTime begunAt; +@override final DateTime endedAt; +@override final String identifier; +@override final bool isActive; +@override final bool isFreeTrial; +@override final int status; +@override final String paymentMethod; + final Map<String, dynamic> _paymentDetails; +@override Map<String, dynamic> get paymentDetails { + if (_paymentDetails is EqualUnmodifiableMapView) return _paymentDetails; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_paymentDetails); +} + +@override final double basePrice; +@override final String? couponId; +@override final dynamic coupon; +@override final DateTime renewalAt; +@override final String accountId; +@override final SnAccount? account; +@override final bool isAvailable; +@override final double finalPrice; +@override final DateTime createdAt; +@override final DateTime updatedAt; +@override final DateTime? deletedAt; + +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SnWalletSubscriptionCopyWith<_SnWalletSubscription> get copyWith => __$SnWalletSubscriptionCopyWithImpl<_SnWalletSubscription>(this, _$identity); + +@override +Map<String, dynamic> toJson() { + return _$SnWalletSubscriptionToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnWalletSubscription&&(identical(other.id, id) || other.id == id)&&(identical(other.begunAt, begunAt) || other.begunAt == begunAt)&&(identical(other.endedAt, endedAt) || other.endedAt == endedAt)&&(identical(other.identifier, identifier) || other.identifier == identifier)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.isFreeTrial, isFreeTrial) || other.isFreeTrial == isFreeTrial)&&(identical(other.status, status) || other.status == status)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other._paymentDetails, _paymentDetails)&&(identical(other.basePrice, basePrice) || other.basePrice == basePrice)&&(identical(other.couponId, couponId) || other.couponId == couponId)&&const DeepCollectionEquality().equals(other.coupon, coupon)&&(identical(other.renewalAt, renewalAt) || other.renewalAt == renewalAt)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.isAvailable, isAvailable) || other.isAvailable == isAvailable)&&(identical(other.finalPrice, finalPrice) || other.finalPrice == finalPrice)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,begunAt,endedAt,identifier,isActive,isFreeTrial,status,paymentMethod,const DeepCollectionEquality().hash(_paymentDetails),basePrice,couponId,const DeepCollectionEquality().hash(coupon),renewalAt,accountId,account,isAvailable,finalPrice,createdAt,updatedAt,deletedAt]); + +@override +String toString() { + return 'SnWalletSubscription(id: $id, begunAt: $begunAt, endedAt: $endedAt, identifier: $identifier, isActive: $isActive, isFreeTrial: $isFreeTrial, status: $status, paymentMethod: $paymentMethod, paymentDetails: $paymentDetails, basePrice: $basePrice, couponId: $couponId, coupon: $coupon, renewalAt: $renewalAt, accountId: $accountId, account: $account, isAvailable: $isAvailable, finalPrice: $finalPrice, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)'; +} + + +} + +/// @nodoc +abstract mixin class _$SnWalletSubscriptionCopyWith<$Res> implements $SnWalletSubscriptionCopyWith<$Res> { + factory _$SnWalletSubscriptionCopyWith(_SnWalletSubscription value, $Res Function(_SnWalletSubscription) _then) = __$SnWalletSubscriptionCopyWithImpl; +@override @useResult +$Res call({ + String id, DateTime begunAt, DateTime endedAt, String identifier, bool isActive, bool isFreeTrial, int status, String paymentMethod, Map<String, dynamic> paymentDetails, double basePrice, String? couponId, dynamic coupon, DateTime renewalAt, String accountId, SnAccount? account, bool isAvailable, double finalPrice, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt +}); + + +@override $SnAccountCopyWith<$Res>? get account; + +} +/// @nodoc +class __$SnWalletSubscriptionCopyWithImpl<$Res> + implements _$SnWalletSubscriptionCopyWith<$Res> { + __$SnWalletSubscriptionCopyWithImpl(this._self, this._then); + + final _SnWalletSubscription _self; + final $Res Function(_SnWalletSubscription) _then; + +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? begunAt = null,Object? endedAt = null,Object? identifier = null,Object? isActive = null,Object? isFreeTrial = null,Object? status = null,Object? paymentMethod = null,Object? paymentDetails = null,Object? basePrice = null,Object? couponId = freezed,Object? coupon = freezed,Object? renewalAt = null,Object? accountId = null,Object? account = freezed,Object? isAvailable = null,Object? finalPrice = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { + return _then(_SnWalletSubscription( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,begunAt: null == begunAt ? _self.begunAt : begunAt // ignore: cast_nullable_to_non_nullable +as DateTime,endedAt: null == endedAt ? _self.endedAt : endedAt // ignore: cast_nullable_to_non_nullable +as DateTime,identifier: null == identifier ? _self.identifier : identifier // ignore: cast_nullable_to_non_nullable +as String,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool,isFreeTrial: null == isFreeTrial ? _self.isFreeTrial : isFreeTrial // ignore: cast_nullable_to_non_nullable +as bool,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as int,paymentMethod: null == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String,paymentDetails: null == paymentDetails ? _self._paymentDetails : paymentDetails // ignore: cast_nullable_to_non_nullable +as Map<String, dynamic>,basePrice: null == basePrice ? _self.basePrice : basePrice // ignore: cast_nullable_to_non_nullable +as double,couponId: freezed == couponId ? _self.couponId : couponId // ignore: cast_nullable_to_non_nullable +as String?,coupon: freezed == coupon ? _self.coupon : coupon // ignore: cast_nullable_to_non_nullable +as dynamic,renewalAt: null == renewalAt ? _self.renewalAt : renewalAt // ignore: cast_nullable_to_non_nullable +as DateTime,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as SnAccount?,isAvailable: null == isAvailable ? _self.isAvailable : isAvailable // ignore: cast_nullable_to_non_nullable +as bool,finalPrice: null == finalPrice ? _self.finalPrice : finalPrice // ignore: cast_nullable_to_non_nullable +as double,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable +as DateTime?, + )); +} + +/// Create a copy of SnWalletSubscription +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnAccountCopyWith<$Res>? get account { + if (_self.account == null) { + return null; + } + + return $SnAccountCopyWith<$Res>(_self.account!, (value) { + return _then(_self.copyWith(account: value)); + }); +} +} + // dart format on diff --git a/lib/models/wallet.g.dart b/lib/models/wallet.g.dart index 1523309..9dd3904 100644 --- a/lib/models/wallet.g.dart +++ b/lib/models/wallet.g.dart @@ -100,3 +100,59 @@ Map<String, dynamic> _$SnTransactionToJson(_SnTransaction instance) => 'updated_at': instance.updatedAt.toIso8601String(), 'deleted_at': instance.deletedAt?.toIso8601String(), }; + +_SnWalletSubscription _$SnWalletSubscriptionFromJson( + Map<String, dynamic> json, +) => _SnWalletSubscription( + id: json['id'] as String, + begunAt: DateTime.parse(json['begun_at'] as String), + endedAt: DateTime.parse(json['ended_at'] as String), + identifier: json['identifier'] as String, + isActive: json['is_active'] as bool, + isFreeTrial: json['is_free_trial'] as bool, + status: (json['status'] as num).toInt(), + paymentMethod: json['payment_method'] as String, + paymentDetails: json['payment_details'] as Map<String, dynamic>, + basePrice: (json['base_price'] as num).toDouble(), + couponId: json['coupon_id'] as String?, + coupon: json['coupon'], + renewalAt: DateTime.parse(json['renewal_at'] as String), + accountId: json['account_id'] as String, + account: + json['account'] == null + ? null + : SnAccount.fromJson(json['account'] as Map<String, dynamic>), + isAvailable: json['is_available'] as bool, + finalPrice: (json['final_price'] as num).toDouble(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + deletedAt: + json['deleted_at'] == null + ? null + : DateTime.parse(json['deleted_at'] as String), +); + +Map<String, dynamic> _$SnWalletSubscriptionToJson( + _SnWalletSubscription instance, +) => <String, dynamic>{ + 'id': instance.id, + 'begun_at': instance.begunAt.toIso8601String(), + 'ended_at': instance.endedAt.toIso8601String(), + 'identifier': instance.identifier, + 'is_active': instance.isActive, + 'is_free_trial': instance.isFreeTrial, + 'status': instance.status, + 'payment_method': instance.paymentMethod, + 'payment_details': instance.paymentDetails, + 'base_price': instance.basePrice, + 'coupon_id': instance.couponId, + 'coupon': instance.coupon, + 'renewal_at': instance.renewalAt.toIso8601String(), + 'account_id': instance.accountId, + 'account': instance.account?.toJson(), + 'is_available': instance.isAvailable, + 'final_price': instance.finalPrice, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'deleted_at': instance.deletedAt?.toIso8601String(), +}; diff --git a/lib/route.dart b/lib/route.dart index d350e1c..fdfdd9c 100644 --- a/lib/route.dart +++ b/lib/route.dart @@ -34,6 +34,7 @@ class AppRouter extends RootStackRouter { AutoRoute(page: RelationshipRoute.page, path: 'relationships'), AutoRoute(page: AccountProfileRoute.page, path: ':name'), AutoRoute(page: UpdateProfileRoute.page, path: 'me/update'), + AutoRoute(page: LevelingRoute.page, path: 'me/leveling'), AutoRoute(page: AccountSettingsRoute.page, path: 'settings'), ], ), diff --git a/lib/route.gr.dart b/lib/route.gr.dart index bde5b1f..1376f14 100644 --- a/lib/route.gr.dart +++ b/lib/route.gr.dart @@ -9,18 +9,19 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i29; -import 'package:flutter/foundation.dart' as _i31; -import 'package:flutter/material.dart' as _i30; -import 'package:island/models/post.dart' as _i32; +import 'package:auto_route/auto_route.dart' as _i30; +import 'package:flutter/foundation.dart' as _i32; +import 'package:flutter/material.dart' as _i31; +import 'package:island/models/post.dart' as _i33; import 'package:island/screens/account.dart' as _i2; import 'package:island/screens/account/event_calendar.dart' as _i16; +import 'package:island/screens/account/leveling.dart' as _i18; import 'package:island/screens/account/me/settings.dart' as _i3; -import 'package:island/screens/account/me/update.dart' as _i27; +import 'package:island/screens/account/me/update.dart' as _i28; import 'package:island/screens/account/profile.dart' as _i1; -import 'package:island/screens/account/relationship.dart' as _i24; +import 'package:island/screens/account/relationship.dart' as _i25; import 'package:island/screens/auth/create_account.dart' as _i9; -import 'package:island/screens/auth/login.dart' as _i18; +import 'package:island/screens/auth/login.dart' as _i19; import 'package:island/screens/chat/call.dart' as _i5; import 'package:island/screens/chat/chat.dart' as _i7; import 'package:island/screens/chat/room.dart' as _i8; @@ -31,24 +32,24 @@ import 'package:island/screens/creators/publishers.dart' as _i12; import 'package:island/screens/creators/stickers/pack_detail.dart' as _i15; import 'package:island/screens/creators/stickers/stickers.dart' as _i14; import 'package:island/screens/explore.dart' as _i17; -import 'package:island/screens/notification.dart' as _i19; -import 'package:island/screens/posts/compose.dart' as _i20; +import 'package:island/screens/notification.dart' as _i20; +import 'package:island/screens/posts/compose.dart' as _i21; import 'package:island/screens/posts/compose_article.dart' as _i4; -import 'package:island/screens/posts/detail.dart' as _i21; -import 'package:island/screens/posts/pub_profile.dart' as _i22; -import 'package:island/screens/realm/detail.dart' as _i23; +import 'package:island/screens/posts/detail.dart' as _i22; +import 'package:island/screens/posts/pub_profile.dart' as _i23; +import 'package:island/screens/realm/detail.dart' as _i24; import 'package:island/screens/realm/realms.dart' as _i13; -import 'package:island/screens/settings.dart' as _i25; -import 'package:island/screens/tabs.dart' as _i26; -import 'package:island/screens/wallet.dart' as _i28; +import 'package:island/screens/settings.dart' as _i26; +import 'package:island/screens/tabs.dart' as _i27; +import 'package:island/screens/wallet.dart' as _i29; /// generated route for /// [_i1.AccountProfileScreen] -class AccountProfileRoute extends _i29.PageRouteInfo<AccountProfileRouteArgs> { +class AccountProfileRoute extends _i30.PageRouteInfo<AccountProfileRouteArgs> { AccountProfileRoute({ - _i30.Key? key, + _i31.Key? key, required String name, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( AccountProfileRoute.name, args: AccountProfileRouteArgs(key: key, name: name), @@ -58,7 +59,7 @@ class AccountProfileRoute extends _i29.PageRouteInfo<AccountProfileRouteArgs> { static const String name = 'AccountProfileRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -74,7 +75,7 @@ class AccountProfileRoute extends _i29.PageRouteInfo<AccountProfileRouteArgs> { class AccountProfileRouteArgs { const AccountProfileRouteArgs({this.key, required this.name}); - final _i30.Key? key; + final _i31.Key? key; final String name; @@ -96,11 +97,11 @@ class AccountProfileRouteArgs { /// generated route for /// [_i2.AccountScreen] -class AccountRoute extends _i29.PageRouteInfo<AccountRouteArgs> { +class AccountRoute extends _i30.PageRouteInfo<AccountRouteArgs> { AccountRoute({ - _i31.Key? key, + _i32.Key? key, bool isAside = false, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( AccountRoute.name, args: AccountRouteArgs(key: key, isAside: isAside), @@ -109,7 +110,7 @@ class AccountRoute extends _i29.PageRouteInfo<AccountRouteArgs> { static const String name = 'AccountRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final args = data.argsAs<AccountRouteArgs>( @@ -123,7 +124,7 @@ class AccountRoute extends _i29.PageRouteInfo<AccountRouteArgs> { class AccountRouteArgs { const AccountRouteArgs({this.key, this.isAside = false}); - final _i31.Key? key; + final _i32.Key? key; final bool isAside; @@ -145,13 +146,13 @@ class AccountRouteArgs { /// generated route for /// [_i3.AccountSettingsScreen] -class AccountSettingsRoute extends _i29.PageRouteInfo<void> { - const AccountSettingsRoute({List<_i29.PageRouteInfo>? children}) +class AccountSettingsRoute extends _i30.PageRouteInfo<void> { + const AccountSettingsRoute({List<_i30.PageRouteInfo>? children}) : super(AccountSettingsRoute.name, initialChildren: children); static const String name = 'AccountSettingsRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i3.AccountSettingsScreen(); @@ -161,13 +162,13 @@ class AccountSettingsRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i2.AccountShellScreen] -class AccountShellRoute extends _i29.PageRouteInfo<void> { - const AccountShellRoute({List<_i29.PageRouteInfo>? children}) +class AccountShellRoute extends _i30.PageRouteInfo<void> { + const AccountShellRoute({List<_i30.PageRouteInfo>? children}) : super(AccountShellRoute.name, initialChildren: children); static const String name = 'AccountShellRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i2.AccountShellScreen(); @@ -177,11 +178,11 @@ class AccountShellRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i4.ArticleComposeScreen] -class ArticleComposeRoute extends _i29.PageRouteInfo<ArticleComposeRouteArgs> { +class ArticleComposeRoute extends _i30.PageRouteInfo<ArticleComposeRouteArgs> { ArticleComposeRoute({ - _i30.Key? key, - _i32.SnPost? originalPost, - List<_i29.PageRouteInfo>? children, + _i31.Key? key, + _i33.SnPost? originalPost, + List<_i30.PageRouteInfo>? children, }) : super( ArticleComposeRoute.name, args: ArticleComposeRouteArgs(key: key, originalPost: originalPost), @@ -190,7 +191,7 @@ class ArticleComposeRoute extends _i29.PageRouteInfo<ArticleComposeRouteArgs> { static const String name = 'ArticleComposeRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final args = data.argsAs<ArticleComposeRouteArgs>( @@ -207,9 +208,9 @@ class ArticleComposeRoute extends _i29.PageRouteInfo<ArticleComposeRouteArgs> { class ArticleComposeRouteArgs { const ArticleComposeRouteArgs({this.key, this.originalPost}); - final _i30.Key? key; + final _i31.Key? key; - final _i32.SnPost? originalPost; + final _i33.SnPost? originalPost; @override String toString() { @@ -229,11 +230,11 @@ class ArticleComposeRouteArgs { /// generated route for /// [_i4.ArticleEditScreen] -class ArticleEditRoute extends _i29.PageRouteInfo<ArticleEditRouteArgs> { +class ArticleEditRoute extends _i30.PageRouteInfo<ArticleEditRouteArgs> { ArticleEditRoute({ - _i30.Key? key, + _i31.Key? key, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( ArticleEditRoute.name, args: ArticleEditRouteArgs(key: key, id: id), @@ -243,7 +244,7 @@ class ArticleEditRoute extends _i29.PageRouteInfo<ArticleEditRouteArgs> { static const String name = 'ArticleEditRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -258,7 +259,7 @@ class ArticleEditRoute extends _i29.PageRouteInfo<ArticleEditRouteArgs> { class ArticleEditRouteArgs { const ArticleEditRouteArgs({this.key, required this.id}); - final _i30.Key? key; + final _i31.Key? key; final String id; @@ -280,11 +281,11 @@ class ArticleEditRouteArgs { /// generated route for /// [_i5.CallScreen] -class CallRoute extends _i29.PageRouteInfo<CallRouteArgs> { +class CallRoute extends _i30.PageRouteInfo<CallRouteArgs> { CallRoute({ - _i30.Key? key, + _i31.Key? key, required String roomId, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( CallRoute.name, args: CallRouteArgs(key: key, roomId: roomId), @@ -294,7 +295,7 @@ class CallRoute extends _i29.PageRouteInfo<CallRouteArgs> { static const String name = 'CallRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -309,7 +310,7 @@ class CallRoute extends _i29.PageRouteInfo<CallRouteArgs> { class CallRouteArgs { const CallRouteArgs({this.key, required this.roomId}); - final _i30.Key? key; + final _i31.Key? key; final String roomId; @@ -331,11 +332,11 @@ class CallRouteArgs { /// generated route for /// [_i6.ChatDetailScreen] -class ChatDetailRoute extends _i29.PageRouteInfo<ChatDetailRouteArgs> { +class ChatDetailRoute extends _i30.PageRouteInfo<ChatDetailRouteArgs> { ChatDetailRoute({ - _i30.Key? key, + _i31.Key? key, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( ChatDetailRoute.name, args: ChatDetailRouteArgs(key: key, id: id), @@ -345,7 +346,7 @@ class ChatDetailRoute extends _i29.PageRouteInfo<ChatDetailRouteArgs> { static const String name = 'ChatDetailRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -360,7 +361,7 @@ class ChatDetailRoute extends _i29.PageRouteInfo<ChatDetailRouteArgs> { class ChatDetailRouteArgs { const ChatDetailRouteArgs({this.key, required this.id}); - final _i30.Key? key; + final _i31.Key? key; final String id; @@ -382,11 +383,11 @@ class ChatDetailRouteArgs { /// generated route for /// [_i7.ChatListScreen] -class ChatListRoute extends _i29.PageRouteInfo<ChatListRouteArgs> { +class ChatListRoute extends _i30.PageRouteInfo<ChatListRouteArgs> { ChatListRoute({ - _i30.Key? key, + _i31.Key? key, bool isAside = false, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( ChatListRoute.name, args: ChatListRouteArgs(key: key, isAside: isAside), @@ -395,7 +396,7 @@ class ChatListRoute extends _i29.PageRouteInfo<ChatListRouteArgs> { static const String name = 'ChatListRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final args = data.argsAs<ChatListRouteArgs>( @@ -409,7 +410,7 @@ class ChatListRoute extends _i29.PageRouteInfo<ChatListRouteArgs> { class ChatListRouteArgs { const ChatListRouteArgs({this.key, this.isAside = false}); - final _i30.Key? key; + final _i31.Key? key; final bool isAside; @@ -431,11 +432,11 @@ class ChatListRouteArgs { /// generated route for /// [_i8.ChatRoomScreen] -class ChatRoomRoute extends _i29.PageRouteInfo<ChatRoomRouteArgs> { +class ChatRoomRoute extends _i30.PageRouteInfo<ChatRoomRouteArgs> { ChatRoomRoute({ - _i31.Key? key, + _i32.Key? key, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( ChatRoomRoute.name, args: ChatRoomRouteArgs(key: key, id: id), @@ -445,7 +446,7 @@ class ChatRoomRoute extends _i29.PageRouteInfo<ChatRoomRouteArgs> { static const String name = 'ChatRoomRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -460,7 +461,7 @@ class ChatRoomRoute extends _i29.PageRouteInfo<ChatRoomRouteArgs> { class ChatRoomRouteArgs { const ChatRoomRouteArgs({this.key, required this.id}); - final _i31.Key? key; + final _i32.Key? key; final String id; @@ -482,13 +483,13 @@ class ChatRoomRouteArgs { /// generated route for /// [_i7.ChatShellScreen] -class ChatShellRoute extends _i29.PageRouteInfo<void> { - const ChatShellRoute({List<_i29.PageRouteInfo>? children}) +class ChatShellRoute extends _i30.PageRouteInfo<void> { + const ChatShellRoute({List<_i30.PageRouteInfo>? children}) : super(ChatShellRoute.name, initialChildren: children); static const String name = 'ChatShellRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i7.ChatShellScreen(); @@ -498,13 +499,13 @@ class ChatShellRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i9.CreateAccountScreen] -class CreateAccountRoute extends _i29.PageRouteInfo<void> { - const CreateAccountRoute({List<_i29.PageRouteInfo>? children}) +class CreateAccountRoute extends _i30.PageRouteInfo<void> { + const CreateAccountRoute({List<_i30.PageRouteInfo>? children}) : super(CreateAccountRoute.name, initialChildren: children); static const String name = 'CreateAccountRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i9.CreateAccountScreen(); @@ -514,11 +515,11 @@ class CreateAccountRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i10.CreatorHubScreen] -class CreatorHubRoute extends _i29.PageRouteInfo<CreatorHubRouteArgs> { +class CreatorHubRoute extends _i30.PageRouteInfo<CreatorHubRouteArgs> { CreatorHubRoute({ - _i30.Key? key, + _i31.Key? key, bool isAside = false, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( CreatorHubRoute.name, args: CreatorHubRouteArgs(key: key, isAside: isAside), @@ -527,7 +528,7 @@ class CreatorHubRoute extends _i29.PageRouteInfo<CreatorHubRouteArgs> { static const String name = 'CreatorHubRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final args = data.argsAs<CreatorHubRouteArgs>( @@ -541,7 +542,7 @@ class CreatorHubRoute extends _i29.PageRouteInfo<CreatorHubRouteArgs> { class CreatorHubRouteArgs { const CreatorHubRouteArgs({this.key, this.isAside = false}); - final _i30.Key? key; + final _i31.Key? key; final bool isAside; @@ -563,13 +564,13 @@ class CreatorHubRouteArgs { /// generated route for /// [_i10.CreatorHubShellScreen] -class CreatorHubShellRoute extends _i29.PageRouteInfo<void> { - const CreatorHubShellRoute({List<_i29.PageRouteInfo>? children}) +class CreatorHubShellRoute extends _i30.PageRouteInfo<void> { + const CreatorHubShellRoute({List<_i30.PageRouteInfo>? children}) : super(CreatorHubShellRoute.name, initialChildren: children); static const String name = 'CreatorHubShellRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i10.CreatorHubShellScreen(); @@ -580,11 +581,11 @@ class CreatorHubShellRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i11.CreatorPostListScreen] class CreatorPostListRoute - extends _i29.PageRouteInfo<CreatorPostListRouteArgs> { + extends _i30.PageRouteInfo<CreatorPostListRouteArgs> { CreatorPostListRoute({ - _i30.Key? key, + _i31.Key? key, required String pubName, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( CreatorPostListRoute.name, args: CreatorPostListRouteArgs(key: key, pubName: pubName), @@ -594,7 +595,7 @@ class CreatorPostListRoute static const String name = 'CreatorPostListRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -611,7 +612,7 @@ class CreatorPostListRoute class CreatorPostListRouteArgs { const CreatorPostListRouteArgs({this.key, required this.pubName}); - final _i30.Key? key; + final _i31.Key? key; final String pubName; @@ -633,8 +634,8 @@ class CreatorPostListRouteArgs { /// generated route for /// [_i7.EditChatScreen] -class EditChatRoute extends _i29.PageRouteInfo<EditChatRouteArgs> { - EditChatRoute({_i30.Key? key, String? id, List<_i29.PageRouteInfo>? children}) +class EditChatRoute extends _i30.PageRouteInfo<EditChatRouteArgs> { + EditChatRoute({_i31.Key? key, String? id, List<_i30.PageRouteInfo>? children}) : super( EditChatRoute.name, args: EditChatRouteArgs(key: key, id: id), @@ -644,7 +645,7 @@ class EditChatRoute extends _i29.PageRouteInfo<EditChatRouteArgs> { static const String name = 'EditChatRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -659,7 +660,7 @@ class EditChatRoute extends _i29.PageRouteInfo<EditChatRouteArgs> { class EditChatRouteArgs { const EditChatRouteArgs({this.key, this.id}); - final _i30.Key? key; + final _i31.Key? key; final String? id; @@ -681,11 +682,11 @@ class EditChatRouteArgs { /// generated route for /// [_i12.EditPublisherScreen] -class EditPublisherRoute extends _i29.PageRouteInfo<EditPublisherRouteArgs> { +class EditPublisherRoute extends _i30.PageRouteInfo<EditPublisherRouteArgs> { EditPublisherRoute({ - _i30.Key? key, + _i31.Key? key, String? name, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( EditPublisherRoute.name, args: EditPublisherRouteArgs(key: key, name: name), @@ -695,7 +696,7 @@ class EditPublisherRoute extends _i29.PageRouteInfo<EditPublisherRouteArgs> { static const String name = 'EditPublisherRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -710,7 +711,7 @@ class EditPublisherRoute extends _i29.PageRouteInfo<EditPublisherRouteArgs> { class EditPublisherRouteArgs { const EditPublisherRouteArgs({this.key, this.name}); - final _i30.Key? key; + final _i31.Key? key; final String? name; @@ -732,11 +733,11 @@ class EditPublisherRouteArgs { /// generated route for /// [_i13.EditRealmScreen] -class EditRealmRoute extends _i29.PageRouteInfo<EditRealmRouteArgs> { +class EditRealmRoute extends _i30.PageRouteInfo<EditRealmRouteArgs> { EditRealmRoute({ - _i30.Key? key, + _i31.Key? key, String? slug, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( EditRealmRoute.name, args: EditRealmRouteArgs(key: key, slug: slug), @@ -746,7 +747,7 @@ class EditRealmRoute extends _i29.PageRouteInfo<EditRealmRouteArgs> { static const String name = 'EditRealmRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -761,7 +762,7 @@ class EditRealmRoute extends _i29.PageRouteInfo<EditRealmRouteArgs> { class EditRealmRouteArgs { const EditRealmRouteArgs({this.key, this.slug}); - final _i30.Key? key; + final _i31.Key? key; final String? slug; @@ -784,12 +785,12 @@ class EditRealmRouteArgs { /// generated route for /// [_i14.EditStickerPacksScreen] class EditStickerPacksRoute - extends _i29.PageRouteInfo<EditStickerPacksRouteArgs> { + extends _i30.PageRouteInfo<EditStickerPacksRouteArgs> { EditStickerPacksRoute({ - _i30.Key? key, + _i31.Key? key, required String pubName, String? packId, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( EditStickerPacksRoute.name, args: EditStickerPacksRouteArgs( @@ -803,7 +804,7 @@ class EditStickerPacksRoute static const String name = 'EditStickerPacksRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -830,7 +831,7 @@ class EditStickerPacksRouteArgs { this.packId, }); - final _i30.Key? key; + final _i31.Key? key; final String pubName; @@ -856,12 +857,12 @@ class EditStickerPacksRouteArgs { /// generated route for /// [_i15.EditStickersScreen] -class EditStickersRoute extends _i29.PageRouteInfo<EditStickersRouteArgs> { +class EditStickersRoute extends _i30.PageRouteInfo<EditStickersRouteArgs> { EditStickersRoute({ - _i30.Key? key, + _i31.Key? key, required String packId, required String? id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( EditStickersRoute.name, args: EditStickersRouteArgs(key: key, packId: packId, id: id), @@ -871,7 +872,7 @@ class EditStickersRoute extends _i29.PageRouteInfo<EditStickersRouteArgs> { static const String name = 'EditStickersRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -898,7 +899,7 @@ class EditStickersRouteArgs { required this.id, }); - final _i30.Key? key; + final _i31.Key? key; final String packId; @@ -922,11 +923,11 @@ class EditStickersRouteArgs { /// generated route for /// [_i16.EventCalanderScreen] -class EventCalanderRoute extends _i29.PageRouteInfo<EventCalanderRouteArgs> { +class EventCalanderRoute extends _i30.PageRouteInfo<EventCalanderRouteArgs> { EventCalanderRoute({ - _i30.Key? key, + _i31.Key? key, required String name, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( EventCalanderRoute.name, args: EventCalanderRouteArgs(key: key, name: name), @@ -936,7 +937,7 @@ class EventCalanderRoute extends _i29.PageRouteInfo<EventCalanderRouteArgs> { static const String name = 'EventCalanderRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -952,7 +953,7 @@ class EventCalanderRoute extends _i29.PageRouteInfo<EventCalanderRouteArgs> { class EventCalanderRouteArgs { const EventCalanderRouteArgs({this.key, required this.name}); - final _i30.Key? key; + final _i31.Key? key; final String name; @@ -974,11 +975,11 @@ class EventCalanderRouteArgs { /// generated route for /// [_i17.ExploreScreen] -class ExploreRoute extends _i29.PageRouteInfo<ExploreRouteArgs> { +class ExploreRoute extends _i30.PageRouteInfo<ExploreRouteArgs> { ExploreRoute({ - _i30.Key? key, + _i31.Key? key, bool isAside = false, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( ExploreRoute.name, args: ExploreRouteArgs(key: key, isAside: isAside), @@ -987,7 +988,7 @@ class ExploreRoute extends _i29.PageRouteInfo<ExploreRouteArgs> { static const String name = 'ExploreRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final args = data.argsAs<ExploreRouteArgs>( @@ -1001,7 +1002,7 @@ class ExploreRoute extends _i29.PageRouteInfo<ExploreRouteArgs> { class ExploreRouteArgs { const ExploreRouteArgs({this.key, this.isAside = false}); - final _i30.Key? key; + final _i31.Key? key; final bool isAside; @@ -1023,13 +1024,13 @@ class ExploreRouteArgs { /// generated route for /// [_i17.ExploreShellScreen] -class ExploreShellRoute extends _i29.PageRouteInfo<void> { - const ExploreShellRoute({List<_i29.PageRouteInfo>? children}) +class ExploreShellRoute extends _i30.PageRouteInfo<void> { + const ExploreShellRoute({List<_i30.PageRouteInfo>? children}) : super(ExploreShellRoute.name, initialChildren: children); static const String name = 'ExploreShellRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i17.ExploreShellScreen(); @@ -1038,30 +1039,46 @@ class ExploreShellRoute extends _i29.PageRouteInfo<void> { } /// generated route for -/// [_i18.LoginScreen] -class LoginRoute extends _i29.PageRouteInfo<void> { - const LoginRoute({List<_i29.PageRouteInfo>? children}) +/// [_i18.LevelingScreen] +class LevelingRoute extends _i30.PageRouteInfo<void> { + const LevelingRoute({List<_i30.PageRouteInfo>? children}) + : super(LevelingRoute.name, initialChildren: children); + + static const String name = 'LevelingRoute'; + + static _i30.PageInfo page = _i30.PageInfo( + name, + builder: (data) { + return const _i18.LevelingScreen(); + }, + ); +} + +/// generated route for +/// [_i19.LoginScreen] +class LoginRoute extends _i30.PageRouteInfo<void> { + const LoginRoute({List<_i30.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i18.LoginScreen(); + return const _i19.LoginScreen(); }, ); } /// generated route for /// [_i7.NewChatScreen] -class NewChatRoute extends _i29.PageRouteInfo<void> { - const NewChatRoute({List<_i29.PageRouteInfo>? children}) +class NewChatRoute extends _i30.PageRouteInfo<void> { + const NewChatRoute({List<_i30.PageRouteInfo>? children}) : super(NewChatRoute.name, initialChildren: children); static const String name = 'NewChatRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i7.NewChatScreen(); @@ -1071,13 +1088,13 @@ class NewChatRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i12.NewPublisherScreen] -class NewPublisherRoute extends _i29.PageRouteInfo<void> { - const NewPublisherRoute({List<_i29.PageRouteInfo>? children}) +class NewPublisherRoute extends _i30.PageRouteInfo<void> { + const NewPublisherRoute({List<_i30.PageRouteInfo>? children}) : super(NewPublisherRoute.name, initialChildren: children); static const String name = 'NewPublisherRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i12.NewPublisherScreen(); @@ -1087,13 +1104,13 @@ class NewPublisherRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i13.NewRealmScreen] -class NewRealmRoute extends _i29.PageRouteInfo<void> { - const NewRealmRoute({List<_i29.PageRouteInfo>? children}) +class NewRealmRoute extends _i30.PageRouteInfo<void> { + const NewRealmRoute({List<_i30.PageRouteInfo>? children}) : super(NewRealmRoute.name, initialChildren: children); static const String name = 'NewRealmRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i13.NewRealmScreen(); @@ -1104,11 +1121,11 @@ class NewRealmRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i14.NewStickerPacksScreen] class NewStickerPacksRoute - extends _i29.PageRouteInfo<NewStickerPacksRouteArgs> { + extends _i30.PageRouteInfo<NewStickerPacksRouteArgs> { NewStickerPacksRoute({ - _i30.Key? key, + _i31.Key? key, required String pubName, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( NewStickerPacksRoute.name, args: NewStickerPacksRouteArgs(key: key, pubName: pubName), @@ -1118,7 +1135,7 @@ class NewStickerPacksRoute static const String name = 'NewStickerPacksRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1135,7 +1152,7 @@ class NewStickerPacksRoute class NewStickerPacksRouteArgs { const NewStickerPacksRouteArgs({this.key, required this.pubName}); - final _i30.Key? key; + final _i31.Key? key; final String pubName; @@ -1157,11 +1174,11 @@ class NewStickerPacksRouteArgs { /// generated route for /// [_i15.NewStickersScreen] -class NewStickersRoute extends _i29.PageRouteInfo<NewStickersRouteArgs> { +class NewStickersRoute extends _i30.PageRouteInfo<NewStickersRouteArgs> { NewStickersRoute({ - _i30.Key? key, + _i31.Key? key, required String packId, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( NewStickersRoute.name, args: NewStickersRouteArgs(key: key, packId: packId), @@ -1171,7 +1188,7 @@ class NewStickersRoute extends _i29.PageRouteInfo<NewStickersRouteArgs> { static const String name = 'NewStickersRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1187,7 +1204,7 @@ class NewStickersRoute extends _i29.PageRouteInfo<NewStickersRouteArgs> { class NewStickersRouteArgs { const NewStickersRouteArgs({this.key, required this.packId}); - final _i30.Key? key; + final _i31.Key? key; final String packId; @@ -1208,31 +1225,31 @@ class NewStickersRouteArgs { } /// generated route for -/// [_i19.NotificationScreen] -class NotificationRoute extends _i29.PageRouteInfo<void> { - const NotificationRoute({List<_i29.PageRouteInfo>? children}) +/// [_i20.NotificationScreen] +class NotificationRoute extends _i30.PageRouteInfo<void> { + const NotificationRoute({List<_i30.PageRouteInfo>? children}) : super(NotificationRoute.name, initialChildren: children); static const String name = 'NotificationRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i19.NotificationScreen(); + return const _i20.NotificationScreen(); }, ); } /// generated route for -/// [_i20.PostComposeScreen] -class PostComposeRoute extends _i29.PageRouteInfo<PostComposeRouteArgs> { +/// [_i21.PostComposeScreen] +class PostComposeRoute extends _i30.PageRouteInfo<PostComposeRouteArgs> { PostComposeRoute({ - _i30.Key? key, - _i32.SnPost? originalPost, - _i32.SnPost? repliedPost, - _i32.SnPost? forwardedPost, + _i31.Key? key, + _i33.SnPost? originalPost, + _i33.SnPost? repliedPost, + _i33.SnPost? forwardedPost, int? type, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( PostComposeRoute.name, args: PostComposeRouteArgs( @@ -1248,14 +1265,14 @@ class PostComposeRoute extends _i29.PageRouteInfo<PostComposeRouteArgs> { static const String name = 'PostComposeRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final queryParams = data.queryParams; final args = data.argsAs<PostComposeRouteArgs>( orElse: () => PostComposeRouteArgs(type: queryParams.optInt('type')), ); - return _i20.PostComposeScreen( + return _i21.PostComposeScreen( key: args.key, originalPost: args.originalPost, repliedPost: args.repliedPost, @@ -1275,13 +1292,13 @@ class PostComposeRouteArgs { this.type, }); - final _i30.Key? key; + final _i31.Key? key; - final _i32.SnPost? originalPost; + final _i33.SnPost? originalPost; - final _i32.SnPost? repliedPost; + final _i33.SnPost? repliedPost; - final _i32.SnPost? forwardedPost; + final _i33.SnPost? forwardedPost; final int? type; @@ -1311,12 +1328,12 @@ class PostComposeRouteArgs { } /// generated route for -/// [_i21.PostDetailScreen] -class PostDetailRoute extends _i29.PageRouteInfo<PostDetailRouteArgs> { +/// [_i22.PostDetailScreen] +class PostDetailRoute extends _i30.PageRouteInfo<PostDetailRouteArgs> { PostDetailRoute({ - _i30.Key? key, + _i31.Key? key, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( PostDetailRoute.name, args: PostDetailRouteArgs(key: key, id: id), @@ -1326,14 +1343,14 @@ class PostDetailRoute extends _i29.PageRouteInfo<PostDetailRouteArgs> { static const String name = 'PostDetailRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs<PostDetailRouteArgs>( orElse: () => PostDetailRouteArgs(id: pathParams.getString('id')), ); - return _i21.PostDetailScreen(key: args.key, id: args.id); + return _i22.PostDetailScreen(key: args.key, id: args.id); }, ); } @@ -1341,7 +1358,7 @@ class PostDetailRoute extends _i29.PageRouteInfo<PostDetailRouteArgs> { class PostDetailRouteArgs { const PostDetailRouteArgs({this.key, required this.id}); - final _i30.Key? key; + final _i31.Key? key; final String id; @@ -1362,12 +1379,12 @@ class PostDetailRouteArgs { } /// generated route for -/// [_i20.PostEditScreen] -class PostEditRoute extends _i29.PageRouteInfo<PostEditRouteArgs> { +/// [_i21.PostEditScreen] +class PostEditRoute extends _i30.PageRouteInfo<PostEditRouteArgs> { PostEditRoute({ - _i30.Key? key, + _i31.Key? key, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( PostEditRoute.name, args: PostEditRouteArgs(key: key, id: id), @@ -1377,14 +1394,14 @@ class PostEditRoute extends _i29.PageRouteInfo<PostEditRouteArgs> { static const String name = 'PostEditRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs<PostEditRouteArgs>( orElse: () => PostEditRouteArgs(id: pathParams.getString('id')), ); - return _i20.PostEditScreen(key: args.key, id: args.id); + return _i21.PostEditScreen(key: args.key, id: args.id); }, ); } @@ -1392,7 +1409,7 @@ class PostEditRoute extends _i29.PageRouteInfo<PostEditRouteArgs> { class PostEditRouteArgs { const PostEditRouteArgs({this.key, required this.id}); - final _i30.Key? key; + final _i31.Key? key; final String id; @@ -1413,13 +1430,13 @@ class PostEditRouteArgs { } /// generated route for -/// [_i22.PublisherProfileScreen] +/// [_i23.PublisherProfileScreen] class PublisherProfileRoute - extends _i29.PageRouteInfo<PublisherProfileRouteArgs> { + extends _i30.PageRouteInfo<PublisherProfileRouteArgs> { PublisherProfileRoute({ - _i30.Key? key, + _i31.Key? key, required String name, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( PublisherProfileRoute.name, args: PublisherProfileRouteArgs(key: key, name: name), @@ -1429,7 +1446,7 @@ class PublisherProfileRoute static const String name = 'PublisherProfileRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1437,7 +1454,7 @@ class PublisherProfileRoute orElse: () => PublisherProfileRouteArgs(name: pathParams.getString('name')), ); - return _i22.PublisherProfileScreen(key: args.key, name: args.name); + return _i23.PublisherProfileScreen(key: args.key, name: args.name); }, ); } @@ -1445,7 +1462,7 @@ class PublisherProfileRoute class PublisherProfileRouteArgs { const PublisherProfileRouteArgs({this.key, required this.name}); - final _i30.Key? key; + final _i31.Key? key; final String name; @@ -1466,12 +1483,12 @@ class PublisherProfileRouteArgs { } /// generated route for -/// [_i23.RealmDetailScreen] -class RealmDetailRoute extends _i29.PageRouteInfo<RealmDetailRouteArgs> { +/// [_i24.RealmDetailScreen] +class RealmDetailRoute extends _i30.PageRouteInfo<RealmDetailRouteArgs> { RealmDetailRoute({ - _i30.Key? key, + _i31.Key? key, required String slug, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( RealmDetailRoute.name, args: RealmDetailRouteArgs(key: key, slug: slug), @@ -1481,14 +1498,14 @@ class RealmDetailRoute extends _i29.PageRouteInfo<RealmDetailRouteArgs> { static const String name = 'RealmDetailRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs<RealmDetailRouteArgs>( orElse: () => RealmDetailRouteArgs(slug: pathParams.getString('slug')), ); - return _i23.RealmDetailScreen(key: args.key, slug: args.slug); + return _i24.RealmDetailScreen(key: args.key, slug: args.slug); }, ); } @@ -1496,7 +1513,7 @@ class RealmDetailRoute extends _i29.PageRouteInfo<RealmDetailRouteArgs> { class RealmDetailRouteArgs { const RealmDetailRouteArgs({this.key, required this.slug}); - final _i30.Key? key; + final _i31.Key? key; final String slug; @@ -1518,13 +1535,13 @@ class RealmDetailRouteArgs { /// generated route for /// [_i13.RealmListScreen] -class RealmListRoute extends _i29.PageRouteInfo<void> { - const RealmListRoute({List<_i29.PageRouteInfo>? children}) +class RealmListRoute extends _i30.PageRouteInfo<void> { + const RealmListRoute({List<_i30.PageRouteInfo>? children}) : super(RealmListRoute.name, initialChildren: children); static const String name = 'RealmListRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { return const _i13.RealmListScreen(); @@ -1533,33 +1550,33 @@ class RealmListRoute extends _i29.PageRouteInfo<void> { } /// generated route for -/// [_i24.RelationshipScreen] -class RelationshipRoute extends _i29.PageRouteInfo<void> { - const RelationshipRoute({List<_i29.PageRouteInfo>? children}) +/// [_i25.RelationshipScreen] +class RelationshipRoute extends _i30.PageRouteInfo<void> { + const RelationshipRoute({List<_i30.PageRouteInfo>? children}) : super(RelationshipRoute.name, initialChildren: children); static const String name = 'RelationshipRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i24.RelationshipScreen(); + return const _i25.RelationshipScreen(); }, ); } /// generated route for -/// [_i25.SettingsScreen] -class SettingsRoute extends _i29.PageRouteInfo<void> { - const SettingsRoute({List<_i29.PageRouteInfo>? children}) +/// [_i26.SettingsScreen] +class SettingsRoute extends _i30.PageRouteInfo<void> { + const SettingsRoute({List<_i30.PageRouteInfo>? children}) : super(SettingsRoute.name, initialChildren: children); static const String name = 'SettingsRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i25.SettingsScreen(); + return const _i26.SettingsScreen(); }, ); } @@ -1567,12 +1584,12 @@ class SettingsRoute extends _i29.PageRouteInfo<void> { /// generated route for /// [_i15.StickerPackDetailScreen] class StickerPackDetailRoute - extends _i29.PageRouteInfo<StickerPackDetailRouteArgs> { + extends _i30.PageRouteInfo<StickerPackDetailRouteArgs> { StickerPackDetailRoute({ - _i30.Key? key, + _i31.Key? key, required String pubName, required String id, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( StickerPackDetailRoute.name, args: StickerPackDetailRouteArgs(key: key, pubName: pubName, id: id), @@ -1582,7 +1599,7 @@ class StickerPackDetailRoute static const String name = 'StickerPackDetailRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1609,7 +1626,7 @@ class StickerPackDetailRouteArgs { required this.id, }); - final _i30.Key? key; + final _i31.Key? key; final String pubName; @@ -1633,11 +1650,11 @@ class StickerPackDetailRouteArgs { /// generated route for /// [_i14.StickersScreen] -class StickersRoute extends _i29.PageRouteInfo<StickersRouteArgs> { +class StickersRoute extends _i30.PageRouteInfo<StickersRouteArgs> { StickersRoute({ - _i30.Key? key, + _i31.Key? key, required String pubName, - List<_i29.PageRouteInfo>? children, + List<_i30.PageRouteInfo>? children, }) : super( StickersRoute.name, args: StickersRouteArgs(key: key, pubName: pubName), @@ -1647,7 +1664,7 @@ class StickersRoute extends _i29.PageRouteInfo<StickersRouteArgs> { static const String name = 'StickersRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1662,7 +1679,7 @@ class StickersRoute extends _i29.PageRouteInfo<StickersRouteArgs> { class StickersRouteArgs { const StickersRouteArgs({this.key, required this.pubName}); - final _i30.Key? key; + final _i31.Key? key; final String pubName; @@ -1683,49 +1700,49 @@ class StickersRouteArgs { } /// generated route for -/// [_i26.TabsScreen] -class TabsRoute extends _i29.PageRouteInfo<void> { - const TabsRoute({List<_i29.PageRouteInfo>? children}) +/// [_i27.TabsScreen] +class TabsRoute extends _i30.PageRouteInfo<void> { + const TabsRoute({List<_i30.PageRouteInfo>? children}) : super(TabsRoute.name, initialChildren: children); static const String name = 'TabsRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i26.TabsScreen(); + return const _i27.TabsScreen(); }, ); } /// generated route for -/// [_i27.UpdateProfileScreen] -class UpdateProfileRoute extends _i29.PageRouteInfo<void> { - const UpdateProfileRoute({List<_i29.PageRouteInfo>? children}) +/// [_i28.UpdateProfileScreen] +class UpdateProfileRoute extends _i30.PageRouteInfo<void> { + const UpdateProfileRoute({List<_i30.PageRouteInfo>? children}) : super(UpdateProfileRoute.name, initialChildren: children); static const String name = 'UpdateProfileRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i27.UpdateProfileScreen(); + return const _i28.UpdateProfileScreen(); }, ); } /// generated route for -/// [_i28.WalletScreen] -class WalletRoute extends _i29.PageRouteInfo<void> { - const WalletRoute({List<_i29.PageRouteInfo>? children}) +/// [_i29.WalletScreen] +class WalletRoute extends _i30.PageRouteInfo<void> { + const WalletRoute({List<_i30.PageRouteInfo>? children}) : super(WalletRoute.name, initialChildren: children); static const String name = 'WalletRoute'; - static _i29.PageInfo page = _i29.PageInfo( + static _i30.PageInfo page = _i30.PageInfo( name, builder: (data) { - return const _i28.WalletScreen(); + return const _i29.WalletScreen(); }, ); } diff --git a/lib/screens/account.dart b/lib/screens/account.dart index aaa3aee..7ab1acc 100644 --- a/lib/screens/account.dart +++ b/lib/screens/account.dart @@ -140,10 +140,15 @@ class AccountScreen extends HookConsumerWidget { ], ), ).padding(horizontal: 8), - LevelingProgressCard( - level: user.value!.profile.level, - experience: user.value!.profile.experience, - progress: user.value!.profile.levelingProgress, + GestureDetector( + child: LevelingProgressCard( + level: user.value!.profile.level, + experience: user.value!.profile.experience, + progress: user.value!.profile.levelingProgress, + ), + onTap: () { + context.router.push(LevelingRoute()); + }, ).padding(horizontal: 12), Row( children: [ diff --git a/lib/screens/account/leveling.dart b/lib/screens/account/leveling.dart new file mode 100644 index 0000000..c27e9e4 --- /dev/null +++ b/lib/screens/account/leveling.dart @@ -0,0 +1,258 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:island/pods/userinfo.dart'; +import 'package:island/services/responsive.dart'; +import 'package:island/widgets/app_scaffold.dart'; +import 'package:island/widgets/account/leveling_progress.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:gap/gap.dart'; +import 'package:google_fonts/google_fonts.dart'; + +@RoutePage() +class LevelingScreen extends HookConsumerWidget { + const LevelingScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final user = ref.watch(userInfoProvider); + + if (user.value == null) { + return AppScaffold( + appBar: AppBar(title: Text('levelingProgress'.tr())), + body: const Center(child: CircularProgressIndicator()), + ); + } + + final currentLevel = user.value!.profile.level; + final currentExp = user.value!.profile.experience; + final progress = user.value!.profile.levelingProgress; + + return AppScaffold( + appBar: AppBar(title: Text('levelingProgress'.tr())), + body: SingleChildScrollView( + padding: getTabbedPadding(context, horizontal: 20, vertical: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Current Progress Card + LevelingProgressCard( + level: currentLevel, + experience: currentExp, + progress: progress, + ), + const Gap(24), + + // Level Stairs Graph + Text( + 'Level Progress', + style: Theme.of( + context, + ).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.bold), + ), + const Gap(16), + + // Stairs visualization with fixed height and horizontal scroll + _buildLevelStairs(context, currentLevel), + + const Gap(24), + + // Placeholder for unlocked content + Text( + 'Unlocked Features', + style: Theme.of( + context, + ).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.bold), + ), + const Gap(16), + Container( + height: 200, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceContainerLow, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: Theme.of(context).colorScheme.outline.withOpacity(0.2), + ), + ), + child: Center( + child: Text( + 'Unlocked features will be shown here', + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildLevelStairs(BuildContext context, int currentLevel) { + const totalLevels = 14; + const stairHeight = 20.0; + const stairWidth = 50.0; + const containerHeight = 280.0; + + return Container( + height: containerHeight, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: Theme.of(context).colorScheme.outline.withOpacity(0.2), + ), + ), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SizedBox( + width: (totalLevels * (stairWidth + 8)) + 40, + height: containerHeight, + child: CustomPaint( + painter: LevelStairsPainter( + currentLevel: currentLevel, + totalLevels: totalLevels, + primaryColor: Theme.of(context).colorScheme.primary, + surfaceColor: Theme.of(context).colorScheme.surfaceContainerHigh, + onSurfaceColor: Theme.of(context).colorScheme.onSurface, + stairHeight: stairHeight, + stairWidth: stairWidth, + ), + child: Stack( + children: List.generate(totalLevels, (index) { + final level = index + 1; + final isCompleted = level <= currentLevel; + final isCurrent = level == currentLevel; + + // Calculate position from bottom + final bottomPosition = 0.0; + final leftPosition = 20.0 + (index * (stairWidth + 8)); + + // Make higher levels progressively taller + final progressiveHeight = + 40.0 + (index * 15.0); // Base height + progressive increase + + return Positioned( + left: leftPosition, + bottom: bottomPosition, + child: Container( + width: stairWidth, + height: progressiveHeight, + decoration: BoxDecoration( + color: + isCompleted + ? Theme.of(context).colorScheme.primary + : Theme.of( + context, + ).colorScheme.surfaceContainerHigh, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(6), + topRight: Radius.circular(6), + ), + border: + isCurrent + ? Border.all( + color: Theme.of(context).colorScheme.primary, + width: 2, + ) + : null, + boxShadow: + isCurrent + ? [ + BoxShadow( + color: Theme.of( + context, + ).colorScheme.primary.withOpacity(0.3), + blurRadius: 6, + spreadRadius: 1, + ), + ] + : null, + ), + child: Padding( + padding: const EdgeInsets.only(top: 8), + child: Column( + children: [ + Text( + level.toString(), + style: GoogleFonts.robotoMono( + fontSize: 14, + fontWeight: FontWeight.bold, + color: + isCompleted + ? Theme.of(context).colorScheme.onPrimary + : Theme.of(context).colorScheme.onSurface, + ), + ), + if (isCurrent) ...[ + const Gap(4), + Container( + width: 4, + height: 4, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.onPrimary, + shape: BoxShape.circle, + ), + ), + ], + ], + ), + ), + ), + ); + }), + ), + ), + ), + ), + ); + } +} + +class LevelStairsPainter extends CustomPainter { + final int currentLevel; + final int totalLevels; + final Color primaryColor; + final Color surfaceColor; + final Color onSurfaceColor; + final double stairHeight; + final double stairWidth; + + LevelStairsPainter({ + required this.currentLevel, + required this.totalLevels, + required this.primaryColor, + required this.surfaceColor, + required this.onSurfaceColor, + required this.stairHeight, + required this.stairWidth, + }); + + @override + void paint(Canvas canvas, Size size) { + final paint = + Paint() + ..color = surfaceColor.withOpacity(0.2) + ..strokeWidth = 1.5 + ..style = PaintingStyle.stroke; + + // Draw connecting lines between stairs + for (int i = 0; i < totalLevels - 1; i++) { + final startX = 20.0 + (i * (stairWidth + 8)) + stairWidth; + final startHeight = + 40.0 + (i * 15.0); // Progressive height for current stair + final startY = size.height - (20.0 + startHeight); + + final endX = 20.0 + ((i + 1) * (stairWidth + 8)); + final endHeight = + 40.0 + ((i + 1) * 15.0); // Progressive height for next stair + final endY = size.height - (20.0 + endHeight); + + canvas.drawLine(Offset(startX, startY), Offset(endX, endY), paint); + } + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +}