From 805a15f719665652bf926494aae0d8b36d18831f Mon Sep 17 00:00:00 2001 From: ice-brontes <187490541+ice-brontes@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:41:29 +0200 Subject: [PATCH] fix: wallets parsing (#595) ## Description Made a few fields nullable, so they can be parsed properly. ## Type of Change - [x] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Refactoring - [ ] Documentation - [ ] Chore --- .../wallets/model/coin_in_wallet_data.c.dart | 2 +- .../current_user_wallet_views_provider.c.dart | 3 +- .../models/wallet_asset.c.dart | 2 +- .../models/wallet_asset.c.freezed.dart | 16 +++--- .../models/wallet_asset.c.g.dart | 2 +- .../wallet_views/models/coin_in_wallet.c.dart | 2 +- .../models/coin_in_wallet.c.freezed.dart | 29 ++++++----- .../models/coin_in_wallet.c.g.dart | 2 +- .../wallet_views/models/wallet_view.c.dart | 2 +- ...allet_view_aggregation_item.c.freezed.dart | 17 +++++-- .../wallet_view_aggregation_item.c.g.dart | 9 ++-- .../models/wallet_view_coin_data.c.dart | 3 +- .../wallet_view_coin_data.c.freezed.dart | 49 +++++++++---------- .../models/wallet_view_coin_data.c.g.dart | 4 +- .../models/wallet_view_item.c.dart | 2 +- .../models/wallet_view_item.c.freezed.dart | 26 +++++----- .../models/wallet_view_item.c.g.dart | 2 +- 17 files changed, 90 insertions(+), 82 deletions(-) diff --git a/lib/app/features/wallets/model/coin_in_wallet_data.c.dart b/lib/app/features/wallets/model/coin_in_wallet_data.c.dart index b079af6ca..f7a6b6988 100644 --- a/lib/app/features/wallets/model/coin_in_wallet_data.c.dart +++ b/lib/app/features/wallets/model/coin_in_wallet_data.c.dart @@ -11,7 +11,7 @@ class CoinInWalletData with _$CoinInWalletData { required CoinData coin, required double amount, required double balanceUSD, - required String walletId, // real wallet, not wallet view + String? walletId, // real wallet, not wallet view }) = _CoinInWalletData; const CoinInWalletData._(); diff --git a/lib/app/features/wallets/providers/current_user_wallet_views_provider.c.dart b/lib/app/features/wallets/providers/current_user_wallet_views_provider.c.dart index 13b54abb6..7ad51024e 100644 --- a/lib/app/features/wallets/providers/current_user_wallet_views_provider.c.dart +++ b/lib/app/features/wallets/providers/current_user_wallet_views_provider.c.dart @@ -42,8 +42,7 @@ Future> currentUserWalletViews(Ref ref) async { ?.asset; if (asset != null) { - coinAmount = asset.balance; - // TODO: (1) Check the result of formula with other services + coinAmount = double.tryParse(asset.balance) ?? 0; coinBalanceUSD = (coinAmount / pow(10, coinDTO.decimals)) * coinDTO.priceUSD; } } diff --git a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.dart b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.dart index 2eaf856a2..966c5cb4b 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.dart @@ -13,7 +13,7 @@ class WalletAsset with _$WalletAsset { required String? contract, required String symbol, required int decimals, - required double balance, + required String balance, required bool? verified, }) = _WalletAsset; diff --git a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.freezed.dart b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.freezed.dart index a89f5958c..dd1ed23b4 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.freezed.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.freezed.dart @@ -24,7 +24,7 @@ mixin _$WalletAsset { String? get contract => throw _privateConstructorUsedError; String get symbol => throw _privateConstructorUsedError; int get decimals => throw _privateConstructorUsedError; - double get balance => throw _privateConstructorUsedError; + String get balance => throw _privateConstructorUsedError; bool? get verified => throw _privateConstructorUsedError; /// Serializes this WalletAsset to a JSON map. @@ -48,7 +48,7 @@ abstract class $WalletAssetCopyWith<$Res> { String? contract, String symbol, int decimals, - double balance, + String balance, bool? verified}); } @@ -94,7 +94,7 @@ class _$WalletAssetCopyWithImpl<$Res, $Val extends WalletAsset> balance: null == balance ? _value.balance : balance // ignore: cast_nullable_to_non_nullable - as double, + as String, verified: freezed == verified ? _value.verified : verified // ignore: cast_nullable_to_non_nullable @@ -116,7 +116,7 @@ abstract class _$$WalletAssetImplCopyWith<$Res> String? contract, String symbol, int decimals, - double balance, + String balance, bool? verified}); } @@ -160,7 +160,7 @@ class __$$WalletAssetImplCopyWithImpl<$Res> balance: null == balance ? _value.balance : balance // ignore: cast_nullable_to_non_nullable - as double, + as String, verified: freezed == verified ? _value.verified : verified // ignore: cast_nullable_to_non_nullable @@ -192,7 +192,7 @@ class _$WalletAssetImpl implements _WalletAsset { @override final int decimals; @override - final double balance; + final String balance; @override final bool? verified; @@ -244,7 +244,7 @@ abstract class _WalletAsset implements WalletAsset { required final String? contract, required final String symbol, required final int decimals, - required final double balance, + required final String balance, required final bool? verified}) = _$WalletAssetImpl; factory _WalletAsset.fromJson(Map json) = @@ -259,7 +259,7 @@ abstract class _WalletAsset implements WalletAsset { @override int get decimals; @override - double get balance; + String get balance; @override bool? get verified; diff --git a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.g.dart b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.g.dart index e7979f7a9..dcf1ca5e0 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.g.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/get_wallet_assets/models/wallet_asset.c.g.dart @@ -12,7 +12,7 @@ _$WalletAssetImpl _$$WalletAssetImplFromJson(Map json) => contract: json['contract'] as String?, symbol: json['symbol'] as String, decimals: (json['decimals'] as num).toInt(), - balance: (json['balance'] as num).toDouble(), + balance: json['balance'] as String, verified: json['verified'] as bool?, ); diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.dart index fc65f1fab..71609ba5e 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.dart @@ -10,7 +10,7 @@ part 'coin_in_wallet.c.g.dart'; class CoinInWallet with _$CoinInWallet { factory CoinInWallet({ required Coin coin, - required String walletId, + String? walletId, }) = _CoinInWallet; factory CoinInWallet.fromJson(Map json) => diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.freezed.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.freezed.dart index 8134f2582..0590bf38a 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.freezed.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.freezed.dart @@ -21,7 +21,7 @@ CoinInWallet _$CoinInWalletFromJson(Map json) { /// @nodoc mixin _$CoinInWallet { Coin get coin => throw _privateConstructorUsedError; - String get walletId => throw _privateConstructorUsedError; + String? get walletId => throw _privateConstructorUsedError; /// Serializes this CoinInWallet to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -39,7 +39,7 @@ abstract class $CoinInWalletCopyWith<$Res> { CoinInWallet value, $Res Function(CoinInWallet) then) = _$CoinInWalletCopyWithImpl<$Res, CoinInWallet>; @useResult - $Res call({Coin coin, String walletId}); + $Res call({Coin coin, String? walletId}); $CoinCopyWith<$Res> get coin; } @@ -60,17 +60,17 @@ class _$CoinInWalletCopyWithImpl<$Res, $Val extends CoinInWallet> @override $Res call({ Object? coin = null, - Object? walletId = null, + Object? walletId = freezed, }) { return _then(_value.copyWith( coin: null == coin ? _value.coin : coin // ignore: cast_nullable_to_non_nullable as Coin, - walletId: null == walletId + walletId: freezed == walletId ? _value.walletId : walletId // ignore: cast_nullable_to_non_nullable - as String, + as String?, ) as $Val); } @@ -93,7 +93,7 @@ abstract class _$$CoinInWalletImplCopyWith<$Res> __$$CoinInWalletImplCopyWithImpl<$Res>; @override @useResult - $Res call({Coin coin, String walletId}); + $Res call({Coin coin, String? walletId}); @override $CoinCopyWith<$Res> get coin; @@ -113,17 +113,17 @@ class __$$CoinInWalletImplCopyWithImpl<$Res> @override $Res call({ Object? coin = null, - Object? walletId = null, + Object? walletId = freezed, }) { return _then(_$CoinInWalletImpl( coin: null == coin ? _value.coin : coin // ignore: cast_nullable_to_non_nullable as Coin, - walletId: null == walletId + walletId: freezed == walletId ? _value.walletId : walletId // ignore: cast_nullable_to_non_nullable - as String, + as String?, )); } } @@ -131,7 +131,7 @@ class __$$CoinInWalletImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$CoinInWalletImpl implements _CoinInWallet { - _$CoinInWalletImpl({required this.coin, required this.walletId}); + _$CoinInWalletImpl({required this.coin, this.walletId}); factory _$CoinInWalletImpl.fromJson(Map json) => _$$CoinInWalletImplFromJson(json); @@ -139,7 +139,7 @@ class _$CoinInWalletImpl implements _CoinInWallet { @override final Coin coin; @override - final String walletId; + final String? walletId; @override String toString() { @@ -177,9 +177,8 @@ class _$CoinInWalletImpl implements _CoinInWallet { } abstract class _CoinInWallet implements CoinInWallet { - factory _CoinInWallet( - {required final Coin coin, - required final String walletId}) = _$CoinInWalletImpl; + factory _CoinInWallet({required final Coin coin, final String? walletId}) = + _$CoinInWalletImpl; factory _CoinInWallet.fromJson(Map json) = _$CoinInWalletImpl.fromJson; @@ -187,7 +186,7 @@ abstract class _CoinInWallet implements CoinInWallet { @override Coin get coin; @override - String get walletId; + String? get walletId; /// Create a copy of CoinInWallet /// with the given fields replaced by the non-null parameter values. diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.g.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.g.dart index f232cfd3d..d689b1fef 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.g.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/coin_in_wallet.c.g.dart @@ -9,7 +9,7 @@ part of 'coin_in_wallet.c.dart'; _$CoinInWalletImpl _$$CoinInWalletImplFromJson(Map json) => _$CoinInWalletImpl( coin: Coin.fromJson(json['coin'] as Map), - walletId: json['walletId'] as String, + walletId: json['walletId'] as String?, ); Map _$$CoinInWalletImplToJson(_$CoinInWalletImpl instance) => diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view.c.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view.c.dart index 3bdc8f666..41ccd733b 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view.c.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view.c.dart @@ -35,7 +35,7 @@ class CoinInWalletListConverter implements JsonConverter, Lis return json.map((e) { final json = e as Map; return CoinInWallet( - walletId: json['walletId'] as String, + walletId: json['walletId'] as String?, coin: Coin.fromJson(json), ); }).toList(); diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.freezed.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.freezed.dart index 46d889046..6286f6b58 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.freezed.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.freezed.dart @@ -21,6 +21,7 @@ WalletViewAggregationItem _$WalletViewAggregationItemFromJson( /// @nodoc mixin _$WalletViewAggregationItem { + @JsonKey(defaultValue: []) List get wallets => throw _privateConstructorUsedError; double get totalBalance => throw _privateConstructorUsedError; @@ -41,7 +42,9 @@ abstract class $WalletViewAggregationItemCopyWith<$Res> { $Res Function(WalletViewAggregationItem) then) = _$WalletViewAggregationItemCopyWithImpl<$Res, WalletViewAggregationItem>; @useResult - $Res call({List wallets, double totalBalance}); + $Res call( + {@JsonKey(defaultValue: []) List wallets, + double totalBalance}); } /// @nodoc @@ -85,7 +88,9 @@ abstract class _$$WalletViewAggregationItemImplCopyWith<$Res> __$$WalletViewAggregationItemImplCopyWithImpl<$Res>; @override @useResult - $Res call({List wallets, double totalBalance}); + $Res call( + {@JsonKey(defaultValue: []) List wallets, + double totalBalance}); } /// @nodoc @@ -123,7 +128,8 @@ class __$$WalletViewAggregationItemImplCopyWithImpl<$Res> @JsonSerializable() class _$WalletViewAggregationItemImpl implements _WalletViewAggregationItem { const _$WalletViewAggregationItemImpl( - {required final List wallets, + {@JsonKey(defaultValue: []) + required final List wallets, required this.totalBalance}) : _wallets = wallets; @@ -132,6 +138,7 @@ class _$WalletViewAggregationItemImpl implements _WalletViewAggregationItem { final List _wallets; @override + @JsonKey(defaultValue: []) List get wallets { if (_wallets is EqualUnmodifiableListView) return _wallets; // ignore: implicit_dynamic_type @@ -180,13 +187,15 @@ class _$WalletViewAggregationItemImpl implements _WalletViewAggregationItem { abstract class _WalletViewAggregationItem implements WalletViewAggregationItem { const factory _WalletViewAggregationItem( - {required final List wallets, + {@JsonKey(defaultValue: []) + required final List wallets, required final double totalBalance}) = _$WalletViewAggregationItemImpl; factory _WalletViewAggregationItem.fromJson(Map json) = _$WalletViewAggregationItemImpl.fromJson; @override + @JsonKey(defaultValue: []) List get wallets; @override double get totalBalance; diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.g.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.g.dart index f4803d24f..3eb3c0139 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.g.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_aggregation_item.c.g.dart @@ -9,10 +9,11 @@ part of 'wallet_view_aggregation_item.c.dart'; _$WalletViewAggregationItemImpl _$$WalletViewAggregationItemImplFromJson( Map json) => _$WalletViewAggregationItemImpl( - wallets: (json['wallets'] as List) - .map((e) => - WalletViewAggregationWallet.fromJson(e as Map)) - .toList(), + wallets: (json['wallets'] as List?) + ?.map((e) => WalletViewAggregationWallet.fromJson( + e as Map)) + .toList() ?? + [], totalBalance: (json['totalBalance'] as num).toDouble(), ); diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.dart index d7ca71f85..4eb20750d 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.dart @@ -8,8 +8,9 @@ part 'wallet_view_coin_data.c.g.dart'; @freezed class WalletViewCoinData with _$WalletViewCoinData { const factory WalletViewCoinData({ - required String walletId, + required String coinId, + String? walletId, }) = _WalletViewCoinData; factory WalletViewCoinData.fromJson(Map json) => diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.freezed.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.freezed.dart index daf651f5c..992b78597 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.freezed.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.freezed.dart @@ -20,8 +20,8 @@ WalletViewCoinData _$WalletViewCoinDataFromJson(Map json) { /// @nodoc mixin _$WalletViewCoinData { - String get walletId => throw _privateConstructorUsedError; String get coinId => throw _privateConstructorUsedError; + String? get walletId => throw _privateConstructorUsedError; /// Serializes this WalletViewCoinData to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -39,7 +39,7 @@ abstract class $WalletViewCoinDataCopyWith<$Res> { WalletViewCoinData value, $Res Function(WalletViewCoinData) then) = _$WalletViewCoinDataCopyWithImpl<$Res, WalletViewCoinData>; @useResult - $Res call({String walletId, String coinId}); + $Res call({String coinId, String? walletId}); } /// @nodoc @@ -57,18 +57,18 @@ class _$WalletViewCoinDataCopyWithImpl<$Res, $Val extends WalletViewCoinData> @pragma('vm:prefer-inline') @override $Res call({ - Object? walletId = null, Object? coinId = null, + Object? walletId = freezed, }) { return _then(_value.copyWith( - walletId: null == walletId - ? _value.walletId - : walletId // ignore: cast_nullable_to_non_nullable - as String, coinId: null == coinId ? _value.coinId : coinId // ignore: cast_nullable_to_non_nullable as String, + walletId: freezed == walletId + ? _value.walletId + : walletId // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } } @@ -81,7 +81,7 @@ abstract class _$$WalletViewCoinDataImplCopyWith<$Res> __$$WalletViewCoinDataImplCopyWithImpl<$Res>; @override @useResult - $Res call({String walletId, String coinId}); + $Res call({String coinId, String? walletId}); } /// @nodoc @@ -97,18 +97,18 @@ class __$$WalletViewCoinDataImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? walletId = null, Object? coinId = null, + Object? walletId = freezed, }) { return _then(_$WalletViewCoinDataImpl( - walletId: null == walletId - ? _value.walletId - : walletId // ignore: cast_nullable_to_non_nullable - as String, coinId: null == coinId ? _value.coinId : coinId // ignore: cast_nullable_to_non_nullable as String, + walletId: freezed == walletId + ? _value.walletId + : walletId // ignore: cast_nullable_to_non_nullable + as String?, )); } } @@ -116,20 +116,19 @@ class __$$WalletViewCoinDataImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$WalletViewCoinDataImpl implements _WalletViewCoinData { - const _$WalletViewCoinDataImpl( - {required this.walletId, required this.coinId}); + const _$WalletViewCoinDataImpl({required this.coinId, this.walletId}); factory _$WalletViewCoinDataImpl.fromJson(Map json) => _$$WalletViewCoinDataImplFromJson(json); - @override - final String walletId; @override final String coinId; + @override + final String? walletId; @override String toString() { - return 'WalletViewCoinData(walletId: $walletId, coinId: $coinId)'; + return 'WalletViewCoinData(coinId: $coinId, walletId: $walletId)'; } @override @@ -137,14 +136,14 @@ class _$WalletViewCoinDataImpl implements _WalletViewCoinData { return identical(this, other) || (other.runtimeType == runtimeType && other is _$WalletViewCoinDataImpl && + (identical(other.coinId, coinId) || other.coinId == coinId) && (identical(other.walletId, walletId) || - other.walletId == walletId) && - (identical(other.coinId, coinId) || other.coinId == coinId)); + other.walletId == walletId)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, walletId, coinId); + int get hashCode => Object.hash(runtimeType, coinId, walletId); /// Create a copy of WalletViewCoinData /// with the given fields replaced by the non-null parameter values. @@ -165,16 +164,16 @@ class _$WalletViewCoinDataImpl implements _WalletViewCoinData { abstract class _WalletViewCoinData implements WalletViewCoinData { const factory _WalletViewCoinData( - {required final String walletId, - required final String coinId}) = _$WalletViewCoinDataImpl; + {required final String coinId, + final String? walletId}) = _$WalletViewCoinDataImpl; factory _WalletViewCoinData.fromJson(Map json) = _$WalletViewCoinDataImpl.fromJson; - @override - String get walletId; @override String get coinId; + @override + String? get walletId; /// Create a copy of WalletViewCoinData /// with the given fields replaced by the non-null parameter values. diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.g.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.g.dart index 6847c70ba..40eb3fa76 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.g.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_coin_data.c.g.dart @@ -9,13 +9,13 @@ part of 'wallet_view_coin_data.c.dart'; _$WalletViewCoinDataImpl _$$WalletViewCoinDataImplFromJson( Map json) => _$WalletViewCoinDataImpl( - walletId: json['walletId'] as String, coinId: json['coinId'] as String, + walletId: json['walletId'] as String?, ); Map _$$WalletViewCoinDataImplToJson( _$WalletViewCoinDataImpl instance) => { - 'walletId': instance.walletId, 'coinId': instance.coinId, + 'walletId': instance.walletId, }; diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.dart index af45d02b3..adfc9a216 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.dart @@ -9,7 +9,7 @@ part 'wallet_view_item.c.g.dart'; class WalletViewItem with _$WalletViewItem { const factory WalletViewItem({ required String coinId, - required String walletId, + String? walletId, }) = _WalletViewItem; factory WalletViewItem.fromJson(Map json) => _$WalletViewItemFromJson(json); diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.freezed.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.freezed.dart index ff08142fe..ecca08c58 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.freezed.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.freezed.dart @@ -21,7 +21,7 @@ WalletViewItem _$WalletViewItemFromJson(Map json) { /// @nodoc mixin _$WalletViewItem { String get coinId => throw _privateConstructorUsedError; - String get walletId => throw _privateConstructorUsedError; + String? get walletId => throw _privateConstructorUsedError; /// Serializes this WalletViewItem to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -39,7 +39,7 @@ abstract class $WalletViewItemCopyWith<$Res> { WalletViewItem value, $Res Function(WalletViewItem) then) = _$WalletViewItemCopyWithImpl<$Res, WalletViewItem>; @useResult - $Res call({String coinId, String walletId}); + $Res call({String coinId, String? walletId}); } /// @nodoc @@ -58,17 +58,17 @@ class _$WalletViewItemCopyWithImpl<$Res, $Val extends WalletViewItem> @override $Res call({ Object? coinId = null, - Object? walletId = null, + Object? walletId = freezed, }) { return _then(_value.copyWith( coinId: null == coinId ? _value.coinId : coinId // ignore: cast_nullable_to_non_nullable as String, - walletId: null == walletId + walletId: freezed == walletId ? _value.walletId : walletId // ignore: cast_nullable_to_non_nullable - as String, + as String?, ) as $Val); } } @@ -81,7 +81,7 @@ abstract class _$$WalletViewItemImplCopyWith<$Res> __$$WalletViewItemImplCopyWithImpl<$Res>; @override @useResult - $Res call({String coinId, String walletId}); + $Res call({String coinId, String? walletId}); } /// @nodoc @@ -98,17 +98,17 @@ class __$$WalletViewItemImplCopyWithImpl<$Res> @override $Res call({ Object? coinId = null, - Object? walletId = null, + Object? walletId = freezed, }) { return _then(_$WalletViewItemImpl( coinId: null == coinId ? _value.coinId : coinId // ignore: cast_nullable_to_non_nullable as String, - walletId: null == walletId + walletId: freezed == walletId ? _value.walletId : walletId // ignore: cast_nullable_to_non_nullable - as String, + as String?, )); } } @@ -116,7 +116,7 @@ class __$$WalletViewItemImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$WalletViewItemImpl implements _WalletViewItem { - const _$WalletViewItemImpl({required this.coinId, required this.walletId}); + const _$WalletViewItemImpl({required this.coinId, this.walletId}); factory _$WalletViewItemImpl.fromJson(Map json) => _$$WalletViewItemImplFromJson(json); @@ -124,7 +124,7 @@ class _$WalletViewItemImpl implements _WalletViewItem { @override final String coinId; @override - final String walletId; + final String? walletId; @override String toString() { @@ -165,7 +165,7 @@ class _$WalletViewItemImpl implements _WalletViewItem { abstract class _WalletViewItem implements WalletViewItem { const factory _WalletViewItem( {required final String coinId, - required final String walletId}) = _$WalletViewItemImpl; + final String? walletId}) = _$WalletViewItemImpl; factory _WalletViewItem.fromJson(Map json) = _$WalletViewItemImpl.fromJson; @@ -173,7 +173,7 @@ abstract class _WalletViewItem implements WalletViewItem { @override String get coinId; @override - String get walletId; + String? get walletId; /// Create a copy of WalletViewItem /// with the given fields replaced by the non-null parameter values. diff --git a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.g.dart b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.g.dart index 41111b963..4e03dd896 100644 --- a/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.g.dart +++ b/packages/ion_identity_client/lib/src/wallets/services/wallet_views/models/wallet_view_item.c.g.dart @@ -9,7 +9,7 @@ part of 'wallet_view_item.c.dart'; _$WalletViewItemImpl _$$WalletViewItemImplFromJson(Map json) => _$WalletViewItemImpl( coinId: json['coinId'] as String, - walletId: json['walletId'] as String, + walletId: json['walletId'] as String?, ); Map _$$WalletViewItemImplToJson(