diff --git a/big-dipper-backend/package.json b/big-dipper-backend/package.json index 077b2c50b8..ef5a80166f 100644 --- a/big-dipper-backend/package.json +++ b/big-dipper-backend/package.json @@ -72,7 +72,7 @@ }, "devDependencies": { "babel-eslint": "^10.1.0", - "chai": "^4.3.4", + "chai": "^4.3.7", "eslint": "^5.16.0", "eslint-config-airbnb": "^17.1.1", "eslint-import-resolver-meteor": "^0.4.0", diff --git a/big-dipper-backend/yarn.lock b/big-dipper-backend/yarn.lock index 240ee25c45..16689dda27 100644 --- a/big-dipper-backend/yarn.lock +++ b/big-dipper-backend/yarn.lock @@ -1125,13 +1125,13 @@ catharsis@^0.9.0: dependencies: lodash "^4.17.15" -chai@^4.3.4: - version "4.3.6" - resolved "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz" +chai@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" dependencies: assertion-error "^1.1.0" check-error "^1.0.2" - deep-eql "^3.0.1" + deep-eql "^4.1.2" get-func-name "^2.0.0" loupe "^2.3.1" pathval "^1.1.1" @@ -1912,9 +1912,9 @@ decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz" +deep-eql@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.2.tgz#270ceb902f87724077e6f6449aed81463f42fc1c" dependencies: type-detect "^4.0.0" diff --git a/wallet/i18n/de.json b/wallet/i18n/de.json index 07b694baf8..722b102922 100644 --- a/wallet/i18n/de.json +++ b/wallet/i18n/de.json @@ -4,6 +4,7 @@ "wallet_retrieving_err_msg": "Wir hatten Probleme beim Abrufen von Wallets aus einem sicheren Speicher.", "home": "Heim", "discover": "Entdecken", + "network_error_description": "Bei der Verarbeitung Ihrer Transaktion ist ein Netzwerkfehler aufgetreten. Bitte versuchen Sie erneut, Ihr Konto zu aktualisieren. Für einen erneuten Versuch werden Ihnen keine doppelten Kosten in Rechnung gestellt.", "market_place": "Marktplatz", "gallery": "Galerie", "my_activity": "Meine Aktivität", @@ -358,8 +359,9 @@ "transaction_date": "Transaktionsdatum", "retry": "Wiederholen", "bought_nft": "Gekauft", + "resolution": "Auflösung", "set_lockscreen": "Instellen als vergrendelscherm", "maintenance_mode_message": "We ondervinden technische problemen en hebben tijdelijk de onderhoudsmodus gestart voor het oplossen van problemen. Maak je geen zorgen, je collectie is veilig. U kunt echter geen on-chain-transacties starten totdat we het probleem hebben opgelost en de normale functionaliteit hebben hersteld.", "maintenance_mode_header": "onderhoudsstand" -} \ No newline at end of file +} diff --git a/wallet/i18n/en.json b/wallet/i18n/en.json index e9c0598a67..e4414d045d 100644 --- a/wallet/i18n/en.json +++ b/wallet/i18n/en.json @@ -358,6 +358,7 @@ "transaction_date": "Transaction Date", "bought_nft": "Bought", "free": "Free", + "resolution": "Resolution", "please_try_again_later": "Please try again later", "checkout": "Checkout", "artist": "Artist", diff --git a/wallet/i18n/es.json b/wallet/i18n/es.json index 39d5416138..8230c9a91a 100644 --- a/wallet/i18n/es.json +++ b/wallet/i18n/es.json @@ -8,6 +8,7 @@ "gallery": "Galería", "my_activity": "Mi actividad", "recommended": "Recomendada", + "network_error_description": "Ocurrió un error de red al procesar su transacción. Vuelva a intentar actualizar su cuenta. No se le cobrará dos veces por volver a intentarlo.", "following": "Siguiendo", "select_a_date": "Seleccione una fecha", "what_is_new": "Qué hay de nuevo", @@ -357,6 +358,7 @@ "buying_pylon_points": "Puntos Pylons Comprados", "transaction_date": "Fecha de Transacción", "retry": "Rever", + "resolution": "resolución", "bought_nft": "Comprado", "set_lockscreen": "Establecer como pantalla de bloqueo", "maintenance_mode_message": "Estamos experimentando problemas técnicos y hemos iniciado temporalmente el modo de mantenimiento para solucionar problemas. No te preocupes, tu colección está segura. Sin embargo, no puede iniciar transacciones en cadena hasta que hayamos resuelto el problema y restablecido la funcionalidad normal.", diff --git a/wallet/i18n/id.json b/wallet/i18n/id.json index 044ecca85a..0ef5f70bb9 100644 --- a/wallet/i18n/id.json +++ b/wallet/i18n/id.json @@ -7,6 +7,7 @@ "market_place": "pasar", "gallery": "Galeri", "my_activity": "Aktivitas Saya", + "network_error_description": "Terjadi kesalahan jaringan saat memproses transaksi Anda. Harap coba lagi untuk memperbarui akun Anda. Anda tidak akan dikenakan biaya dua kali untuk mencoba lagi.", "recommended": "Direkomendasikan", "following": "Mengikuti", "select_a_date": "Pilih tanggal", @@ -358,6 +359,7 @@ "transaction_date": "Tanggal Transaksi", "retry": "Mencoba Kembali", "bought_nft": "Dibeli", + "resolution": "resolusi", "set_lockscreen": "Tetapkan sebagai layar kunci", "maintenance_mode_message": "Kami mengalami masalah teknis dan untuk sementara memulai mode pemeliharaan untuk pemecahan masalah. Jangan khawatir, koleksi Anda aman. Namun, Anda tidak dapat memulai transaksi on-chain sampai kami menyelesaikan masalah dan memulihkan fungsionalitas normal.", "maintenance_mode_header": "Mode Pemeliharaan" diff --git a/wallet/i18n/ja.json b/wallet/i18n/ja.json index a7a90e7f70..dfbb5ccde9 100644 --- a/wallet/i18n/ja.json +++ b/wallet/i18n/ja.json @@ -10,6 +10,7 @@ "recommended": "おすすめされた", "following": "続く", "select_a_date": "日付を選択", + "network_error_description":"トランザクションの処理中にネットワーク エラーが発生しました。アカウントの更新をもう一度お試しください。再試行しても 2 回請求されることはありません。", "what_is_new": "新着情報", "trending": "トレンド", "price": "価格", @@ -357,6 +358,7 @@ "buying_pylon_points": "パイロンポイントを購入", "transaction_date": "取引日", "retry": "リトライ", + "resolution": "解像度", "bought_nft": "買った", "set_lockscreen": "ロック画面に設定", "maintenance_mode_message": "技術的な問題が発生しており、トラブルシューティングのために一時的にメンテナンス モードを開始しました。心配はいりません。あなたのコレクションは安全です。ただし、問題が解決され、通常の機能が回復するまで、オンチェーン トランザクションを開始することはできません。", diff --git a/wallet/i18n/ko.json b/wallet/i18n/ko.json index d48a6f161b..45d4426411 100644 --- a/wallet/i18n/ko.json +++ b/wallet/i18n/ko.json @@ -10,6 +10,7 @@ "recommended": "추천", "following": "수행원", "select_a_date": "날짜 선택", + "network_error_description": "거래를 처리하는 동안 네트워크 오류가 발생했습니다. 계정 업데이트를 다시 시도하십시오. 재시도에 대해 두 번 청구되지 않습니다.", "what_is_new": "새로운 소식", "trending": "트렌드", "price": "가격", @@ -356,6 +357,7 @@ "buying_pylon_points": "파일론 포인트 구매", "transaction_date": "거래 날짜", "retry": "다시 해 보다", + "resolution": "해결", "bought_nft": "구입했다", "set_lockscreen": "잠금 화면으로 설정", "maintenance_mode_message": "기술적인 문제가 발생했으며 문제 해결을 위해 일시적으로 유지 관리 모드를 시작했습니다. 걱정하지 마세요. 컬렉션은 안전합니다. 그러나 문제를 해결하고 정상적인 기능을 복원할 때까지 온체인 트랜잭션을 시작할 수 없습니다.", diff --git a/wallet/i18n/ru.json b/wallet/i18n/ru.json index 59dc5e4327..d0904e2900 100644 --- a/wallet/i18n/ru.json +++ b/wallet/i18n/ru.json @@ -9,6 +9,7 @@ "my_activity": "Моя активность", "recommended": "Рекомендуемый", "following": "Вы подписаны", + "network_error_description": "При обработке транзакции произошла сетевая ошибка. Пожалуйста, попробуйте еще раз, чтобы обновить свою учетную запись. С вас не будет взиматься плата дважды за повторную попытку.", "select_a_date": "Выбрать дату", "what_is_new": "Что нового", "trending": "Трендинг", @@ -358,6 +359,7 @@ "transaction_date": "Дата сделки", "retry": "Повторить попытку", "bought_nft": "Купленный", + "resolution": "разрешающая способность", "set_lockscreen": "Установить как экран блокировки", "maintenance_mode_message": "У нас возникли технические проблемы, и мы временно запустили режим обслуживания для устранения неполадок. Не волнуйтесь, ваша коллекция в безопасности. Однако вы не можете инициировать транзакции в сети, пока мы не решим проблему и не восстановим нормальную работу.", "maintenance_mode_header": "Режим технического обслуживания" diff --git a/wallet/i18n/vi.json b/wallet/i18n/vi.json index 5174ec6ca1..371ec95f66 100644 --- a/wallet/i18n/vi.json +++ b/wallet/i18n/vi.json @@ -10,6 +10,7 @@ "recommended": "Khuyến nghị", "following": "Tiếp theo", "select_a_date": "Chọn một ngày", + "network_error_description": "Đã xảy ra lỗi mạng khi xử lý giao dịch của bạn. Vui lòng thử lại để cập nhật tài khoản của bạn. Bạn sẽ không bị tính phí hai lần khi thử lại.", "what_is_new": "Có gì mới", "trending": "Xu hướng", "price": "Giá bán", @@ -357,6 +358,7 @@ "buying_pylon_points": "Đã mua điểm giá treo", "transaction_date": "Ngày Giao dịch", "retry": "Thử lại", + "resolution": "nghị quyết", "bought_nft": "Đã mua", "set_lockscreen": "Đặt làm màn hình khóa", "maintenance_mode_message": "Chúng tôi đang gặp sự cố kỹ thuật và đã tạm thời bắt đầu chế độ bảo trì để khắc phục sự cố. Đừng lo lắng, bộ sưu tập của bạn vẫn an toàn. Tuy nhiên, bạn không thể bắt đầu các giao dịch trên chuỗi cho đến khi chúng tôi giải quyết xong sự cố và khôi phục chức năng bình thường.", diff --git a/wallet/lib/generated/locale_keys.g.dart b/wallet/lib/generated/locale_keys.g.dart index 0bc00f8ecf..5d444f9935 100644 --- a/wallet/lib/generated/locale_keys.g.dart +++ b/wallet/lib/generated/locale_keys.g.dart @@ -12,6 +12,7 @@ abstract class LocaleKeys { static const recommended = 'recommended'; static const following = 'following'; static const select_a_date = 'select_a_date'; + static const network_error_description = 'network_error_description'; static const what_is_new = 'what_is_new'; static const trending = 'trending'; static const price = 'price'; @@ -359,9 +360,9 @@ abstract class LocaleKeys { static const buying_pylon_points = 'buying_pylon_points'; static const transaction_date = 'transaction_date'; static const retry = 'retry'; + static const resolution = 'resolution'; static const bought_nft = 'bought_nft'; static const set_lockscreen = 'set_lockscreen'; - static const network_error_description = 'network_error_description'; static const maintenance_mode_message = 'maintenance_mode_message'; static const maintenance_mode_header = 'maintenance_mode_header'; diff --git a/wallet/lib/model/favorites.dart b/wallet/lib/model/favorites.dart new file mode 100644 index 0000000000..d3b314591b --- /dev/null +++ b/wallet/lib/model/favorites.dart @@ -0,0 +1,13 @@ +import 'package:floor/floor.dart'; + +@entity +class FavoritesModel { + @primaryKey + final int dateTime; + final String id; + final String cookbookId; + final String type; + + + FavoritesModel({required this.id, required this.cookbookId, required this.type, required this.dateTime}); +} diff --git a/wallet/lib/model/nft.dart b/wallet/lib/model/nft.dart index ef59fb600b..3d586e9520 100644 --- a/wallet/lib/model/nft.dart +++ b/wallet/lib/model/nft.dart @@ -42,6 +42,7 @@ class NFT extends Equatable { String duration = ""; String fileSize = ""; String hashtags = ""; + String cid = ""; String createdAt = ""; bool realWorld = false; @@ -57,6 +58,7 @@ class NFT extends Equatable { this.itemID = "", this.cookbookID = "", this.recipeID = "", + this.cid = "", this.owner = "", this.width = "", this.height = "", @@ -98,6 +100,7 @@ class NFT extends Equatable { description: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kDescription).value, fileSize: getFileSize(item), creator: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kCreator, orElse: () => StringKeyValue(key: kCreator, value: "")).value, + cid: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kCID, orElse: () => StringKeyValue(key: kCID, value: "")).value, appType: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kAppType, orElse: () => StringKeyValue(key: kAppType, value: "")).value, width: item.longs.firstWhere((longKeyValue) => longKeyValue.key == kWidth, orElse: () => LongKeyValue(key: kWidth, value: Int64())).value.toString(), height: item.longs.firstWhere((longKeyValue) => longKeyValue.key == kHeight, orElse: () => LongKeyValue(key: kHeight, value: Int64())).value.toString(), @@ -131,6 +134,7 @@ class NFT extends Equatable { description: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kDescription).value, fileSize: getFileSize(item), creator: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kCreator, orElse: () => StringKeyValue(key: kCreator, value: "")).value, + cid: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kCID, orElse: () => StringKeyValue(key: kCID, value: "")).value, appType: item.strings.firstWhere((strKeyValue) => strKeyValue.key == kAppType, orElse: () => StringKeyValue(key: kAppType, value: "")).value, width: item.longs.firstWhere((longKeyValue) => longKeyValue.key == kWidth, orElse: () => LongKeyValue(key: kWidth, value: Int64())).value.toString(), height: item.longs.firstWhere((longKeyValue) => longKeyValue.key == kHeight, orElse: () => LongKeyValue(key: kHeight, value: Int64())).value.toString(), @@ -161,6 +165,7 @@ class NFT extends Equatable { thumbnailUrl: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kThumbnailUrl, orElse: () => StringParam()).value.changeDomain() ?? "", description: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kDescription, orElse: () => StringParam()).value ?? "", fileSize: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kFileSize, orElse: () => StringParam()).value ?? "", + cid: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kCID, orElse: () => StringParam()).value ?? "", appType: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kAppType, orElse: () => StringParam()).value ?? "", creator: recipe.entries.itemOutputs.firstOrNull?.strings.firstWhere((strKeyValue) => strKeyValue.key == kCreator, orElse: () => StringParam()).value ?? "", width: recipe.entries.itemOutputs.firstOrNull?.longs.firstWhere((longKeyValue) => longKeyValue.key == kWidth, orElse: () => LongParam()).weightRanges.firstOrNull?.upper.toString() ?? "0", diff --git a/wallet/lib/model/transaction_failure_model.dart b/wallet/lib/model/transaction_failure_model.dart index f8f6111310..3ac92ab1fc 100644 --- a/wallet/lib/model/transaction_failure_model.dart +++ b/wallet/lib/model/transaction_failure_model.dart @@ -28,7 +28,11 @@ class LocalTransactionModel extends Equatable { required this.status, }); - factory LocalTransactionModel.fromStatus({required String transactionHash ,required TransactionStatus status, required LocalTransactionModel transactionModel}) { + factory LocalTransactionModel.fromStatus({ + required String transactionHash, + required TransactionStatus status, + required LocalTransactionModel transactionModel, + }) { return LocalTransactionModel( transactionHash: transactionHash, transactionCurrency: transactionModel.transactionCurrency, diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index e9abece609..ccd583d549 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -190,8 +190,6 @@ class OwnerBottomDrawer extends StatefulWidget { class _OwnerBottomDrawerState extends State { bool liked = false; - bool collapsed = true; - bool isExpanded = false; Widget getProgressWidget() { final viewModel = context.read(); @@ -456,7 +454,9 @@ class _OwnerBottomDrawerState extends State { icon: 'trophy', nft: viewModel.nft, owner: viewModel.owner, - NftOwnershipHistoryList: const [], + nftOwnershipHistoryList: const [], + isExpanded: viewModel.isOwnershipExpanded, + onChangeTab: viewModel.onChangeTab, ), SizedBox(height: 10.h), TabField( @@ -464,7 +464,9 @@ class _OwnerBottomDrawerState extends State { icon: 'detail', nft: viewModel.nft, owner: viewModel.owner, - NftOwnershipHistoryList: const [], + nftOwnershipHistoryList: const [], + isExpanded: viewModel.isDetailsExpanded, + onChangeTab: viewModel.onChangeTab, ), SizedBox(height: 10.h), if (viewModel.nft.type != NftType.TYPE_RECIPE) @@ -473,7 +475,9 @@ class _OwnerBottomDrawerState extends State { icon: 'history', nft: viewModel.nft, owner: viewModel.nft.owner, - NftOwnershipHistoryList: viewModel.nftOwnershipHistoryList, + nftOwnershipHistoryList: viewModel.nftOwnershipHistoryList, + isExpanded: viewModel.isHistoryExpanded, + onChangeTab: viewModel.onChangeTab, ), SizedBox(height: 30.h), ], diff --git a/wallet/lib/pages/detailed_asset_view/owner_view_view_model.dart b/wallet/lib/pages/detailed_asset_view/owner_view_view_model.dart index 0e5b3a4ee6..4d0164bfce 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view_view_model.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view_view_model.dart @@ -6,6 +6,7 @@ import 'package:just_audio/just_audio.dart'; import 'package:pylons_wallet/components/loading.dart'; import 'package:pylons_wallet/model/nft.dart'; import 'package:pylons_wallet/model/nft_ownership_history.dart'; +import 'package:pylons_wallet/pages/detailed_asset_view/widgets/tab_fields.dart'; import 'package:pylons_wallet/services/repository/repository.dart'; import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart'; import 'package:pylons_wallet/services/third_party_services/share_helper.dart'; @@ -37,6 +38,11 @@ class OwnerViewViewModel extends ChangeNotifier { required this.accountPublicInfo, }); + TabFields? selectedField; + bool isOwnershipExpanded = false; + bool isHistoryExpanded = false; + bool isDetailsExpanded = false; + String owner = ''; bool _toggled = true; @@ -138,6 +144,48 @@ class OwnerViewViewModel extends ChangeNotifier { toHashtagList(); } + void getWhichTabIsExpanded() { + isDetailsExpanded = false; + isHistoryExpanded = false; + isOwnershipExpanded = false; + + switch (selectedField) { + case TabFields.ownership: + isOwnershipExpanded = true; + notifyListeners(); + break; + case TabFields.history: + isHistoryExpanded = true; + notifyListeners(); + break; + case TabFields.details: + isDetailsExpanded = true; + notifyListeners(); + break; + default: + return; + } + } + + void closeExpansion() { + isDetailsExpanded = false; + isHistoryExpanded = false; + isOwnershipExpanded = false; + notifyListeners(); + } + + void onChangeTab(TabFields tab) { + if (tab == selectedField && isExpansionOpen()) { + closeExpansion(); + return; + } + + selectedField = tab; + getWhichTabIsExpanded(); + } + + bool isExpansionOpen() => isDetailsExpanded || isHistoryExpanded || isOwnershipExpanded; + Future nftDataInit({required String recipeId, required String cookBookId, required String itemId}) async { final walletAddress = accountPublicInfo.publicAddress; if (nft.type != NftType.TYPE_RECIPE) { @@ -426,9 +474,7 @@ class OwnerViewViewModel extends ChangeNotifier { repository.logUserJourney(screenName: AnalyticsScreenEvents.ownerView); } - - - ValueNotifier audioProgressNotifier = ValueNotifier( + ValueNotifier audioProgressNotifier = ValueNotifier( ProgressBarState( current: Duration.zero, buffered: Duration.zero, diff --git a/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart b/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart index adcce6c62c..50f7faa317 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart @@ -12,14 +12,28 @@ import 'package:pylons_wallet/utils/extension.dart'; import '../../../generated/locale_keys.g.dart'; +enum TabFields { ownership, details, history } + +// ignore: must_be_immutable class TabField extends StatefulWidget { final String name; final String icon; final NFT nft; - final List NftOwnershipHistoryList; + final List nftOwnershipHistoryList; final String owner; + bool isExpanded; + final Function(TabFields) onChangeTab; - const TabField({Key? key, required this.name, required this.icon, required this.nft, required this.owner, required this.NftOwnershipHistoryList}) : super(key: key); + TabField({ + Key? key, + required this.name, + required this.icon, + required this.nft, + required this.owner, + required this.nftOwnershipHistoryList, + required this.isExpanded, + required this.onChangeTab, + }) : super(key: key); @override State createState() => _TabFieldState(); @@ -33,9 +47,8 @@ class _TabFieldState extends State { case NftType.TYPE_RECIPE: return { LocaleKeys.owned_by.tr(): widget.owner, - LocaleKeys.edition.tr(): '${widget.nft.amountMinted} of ${widget.nft.quantity}', + LocaleKeys.edition.tr(): '#${widget.nft.amountMinted} of ${widget.nft.quantity}', LocaleKeys.royalty_text.tr(): widget.nft.tradePercentage, - LocaleKeys.size.tr(): widget.nft.getAssetSize(), LocaleKeys.creation.tr(): widget.nft.createdAt, }; case NftType.TYPE_ITEM: @@ -52,26 +65,14 @@ class _TabFieldState extends State { Map getNFTDetailsMap() { switch (widget.nft.type) { case NftType.TYPE_RECIPE: - return { - LocaleKeys.recipe_id.tr(): widget.nft.recipeID, - LocaleKeys.blockchain.tr(): LocaleKeys.pylons.tr(), - LocaleKeys.permission.tr(): LocaleKeys.exclusive.tr(), - }; + return {LocaleKeys.recipe_id.tr(): widget.nft.recipeID, LocaleKeys.resolution.tr(): widget.nft.getAssetSize(), kIpfsCid: widget.nft.cid}; case NftType.TYPE_ITEM: - return { - LocaleKeys.recipe_id.tr(): widget.nft.recipeID, - LocaleKeys.blockchain.tr(): LocaleKeys.pylons.tr(), - LocaleKeys.permission.tr(): LocaleKeys.exclusive.tr(), - }; + return {LocaleKeys.recipe_id.tr(): widget.nft.recipeID, LocaleKeys.resolution.tr(): widget.nft.getAssetSize(), kIpfsCid: widget.nft.cid}; case NftType.TYPE_TRADE: break; } - return { - LocaleKeys.recipe_id.tr(): widget.nft.recipeID, - LocaleKeys.blockchain.tr(): LocaleKeys.pylons.tr(), - LocaleKeys.permission.tr(): LocaleKeys.exclusive.tr(), - }; + return {LocaleKeys.recipe_id.tr(): widget.nft.recipeID, LocaleKeys.resolution.tr(): widget.nft.getAssetSize(), kIpfsCid: widget.nft.cid}; } @override @@ -82,9 +83,7 @@ class _TabFieldState extends State { final listOwnership = ownership.entries.map((element) => _tabDetails(field: element.key, value: element.value)).toList(); - final listDetails = nftDetail.entries - .map((element) => _tabDetails(field: element.key, value: element.value, customWidget: element.key == kRecipeId && element.value.isNotEmpty ? _tabDetailsWithIcon(value: element.value) : null)) - .toList(); + final listDetails = nftDetail.entries.map((element) => _tabDetails(field: element.key, value: element.value, customWidget: customWidget(element))).toList(); return AnimatedContainer( duration: const Duration(milliseconds: 100), @@ -118,15 +117,25 @@ class _TabFieldState extends State { GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { + TabFields? _field; + if (widget.name == LocaleKeys.ownership.tr()) { + _field = TabFields.ownership; + } else if (widget.name == LocaleKeys.nft_detail.tr()) { + _field = TabFields.details; + } else { + _field = TabFields.history; + } + + widget.onChangeTab(_field); setState(() { - collapsed = !collapsed; + widget.isExpanded = !widget.isExpanded; }); }, child: SizedBox( height: 20.h, width: 20.w, child: SvgPicture.asset( - 'assets/images/icons/${collapsed ? 'add' : 'minus'}.svg', + 'assets/images/icons/${!widget.isExpanded ? 'add' : 'minus'}.svg', ), ), ) @@ -147,17 +156,25 @@ class _TabFieldState extends State { ), ], ), - if (!collapsed && widget.name == LocaleKeys.ownership.tr()) + if (widget.name == LocaleKeys.ownership.tr() && widget.isExpanded) ...listOwnership - else if (!collapsed && widget.name == LocaleKeys.nft_detail.tr()) + else if (widget.name == LocaleKeys.nft_detail.tr() && widget.isExpanded) ...listDetails - else if (!collapsed && widget.name == LocaleKeys.history.tr()) - _listHistory(widget.NftOwnershipHistoryList, context) + else if (widget.name == LocaleKeys.history.tr() && widget.isExpanded) + _listHistory(widget.nftOwnershipHistoryList, context) ], ), ); } + Widget? customWidget(MapEntry element) { + return element.key == kRecipeId && element.value.isNotEmpty + ? _tabDetailsWithIcon(value: element.value) + : element.key == kIpfsCid && element.value.isNotEmpty + ? _tabDetailsWithIcon(value: element.value) + : null; + } + Widget _listHistory(List nftOwnershipHistoryList, BuildContext context) { return nftOwnershipHistoryList.isNotEmpty ? ListView.builder( diff --git a/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart b/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart index 6e819357fd..e65a2870aa 100644 --- a/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart +++ b/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart @@ -24,23 +24,23 @@ extension IBCCoinsDePar on IBCCoins { Widget getAssets() { switch (this) { case IBCCoins.urun: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_AGORIC)); + return getIconFromSvg(SVGUtil.WALLET_AGORIC); case IBCCoins.ujunox: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_JUNO)); + return getIconFromSvg(SVGUtil.WALLET_JUNO); case IBCCoins.none: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_AGORIC)); + return getIconFromSvg(SVGUtil.WALLET_AGORIC); case IBCCoins.ujuno: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_JUNO)); + return getIconFromSvg(SVGUtil.WALLET_JUNO); case IBCCoins.upylon: - return SizedBox(width: 30.r, height: 30.r, child: Image.asset(ImageUtil.PYLONS_CURRENCY)); + return getIconFromSvg(SVGUtil.PYLONS_CURRENCY); case IBCCoins.ustripeusd: - return SizedBox(width: 28.r, height: 30.r, child: Image.asset(ImageUtil.WALLET_USD)); + return getIconFromAsset(ImageUtil.WALLET_USD); case IBCCoins.eeur: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_EEUR)); + return getIconFromSvg(SVGUtil.WALLET_EEUR); case IBCCoins.uatom: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_ATOM)); + return getIconFromSvg(SVGUtil.WALLET_ATOM); case IBCCoins.weth_wei: - return SizedBox(width: 30.r, height: 30.r, child: SvgPicture.asset(SVGUtil.WALLET_ETH)); + return getIconFromSvg(SVGUtil.WALLET_ETH); } } @@ -104,6 +104,13 @@ extension IBCCoinsDePar on IBCCoins { } } + String getTrailingAbbrev() { + if (this == IBCCoins.ustripeusd) { + return constants.kStripeUSD_ABR; + } + return constants.kPoints; + } + Color getColor() { switch (this) { case IBCCoins.urun: @@ -163,3 +170,20 @@ extension IBCCoinsDePar on IBCCoins { } } } + +SizedBox getIconFromAsset(String ibcCoinIcon) => SizedBox( + width: 24.r, + height: 24.r, + child: Image.asset( + ibcCoinIcon, + fit: BoxFit.fill, + ), + ); + +SizedBox getIconFromSvg(String ibcCoinIcon) => SizedBox( + width: 24.r, + height: 24.r, + child: SvgPicture.asset( + ibcCoinIcon, + ), + ); diff --git a/wallet/lib/pages/purchase_item/purchase_item_screen.dart b/wallet/lib/pages/purchase_item/purchase_item_screen.dart index 510adb8ebb..a27194c8e5 100644 --- a/wallet/lib/pages/purchase_item/purchase_item_screen.dart +++ b/wallet/lib/pages/purchase_item/purchase_item_screen.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:io'; import 'dart:ui'; - import 'package:bottom_drawer/bottom_drawer.dart'; import 'package:detectable_text_field/detector/sample_regular_expressions.dart'; import 'package:detectable_text_field/widgets/detectable_text.dart'; @@ -91,6 +90,7 @@ class PurchaseItemContent extends StatefulWidget { class _PurchaseItemContentState extends State { bool _showPay = false; + final GlobalKey key = GlobalKey(); final myBottomDrawerController = BottomDrawerController(); @@ -217,7 +217,6 @@ class OwnerBottomDrawer extends StatefulWidget { class _OwnerBottomDrawerState extends State { bool liked = false; bool collapsed = true; - bool isExpanded = false; @override void initState() { @@ -279,7 +278,6 @@ class _OwnerBottomDrawerState extends State { ), getProgressWidget(viewModel), SizedBox( - height: 60.h, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -568,7 +566,9 @@ class _OwnerBottomDrawerState extends State { icon: 'trophy', nft: viewModel.nft, owner: viewModel.nft.owner, - NftOwnershipHistoryList: const [], + nftOwnershipHistoryList: const [], + isExpanded: viewModel.isOwnershipExpanded, + onChangeTab: viewModel.onChangeTab, ), SizedBox(height: 10.h), TabField( @@ -576,11 +576,21 @@ class _OwnerBottomDrawerState extends State { icon: 'detail', nft: viewModel.nft, owner: viewModel.nft.owner, - NftOwnershipHistoryList: const [], + nftOwnershipHistoryList: const [], + isExpanded: viewModel.isDetailsExpanded, + onChangeTab: viewModel.onChangeTab, ), SizedBox(height: 10.h), if (viewModel.nft.type != NftType.TYPE_RECIPE) - TabField(name: LocaleKeys.history.tr(), icon: 'history', nft: viewModel.nft, owner: viewModel.nft.owner, NftOwnershipHistoryList: viewModel.nftOwnershipHistoryList), + TabField( + name: LocaleKeys.history.tr(), + icon: 'history', + nft: viewModel.nft, + owner: viewModel.nft.owner, + nftOwnershipHistoryList: viewModel.nftOwnershipHistoryList, + isExpanded: viewModel.isHistoryExpanded, + onChangeTab: viewModel.onChangeTab, + ), SizedBox(height: 50.h), if (viewModel.nft.amountMinted >= viewModel.nft.quantity) soldOutButton(viewModel) ], @@ -611,22 +621,29 @@ class _OwnerBottomDrawerState extends State { SizedBox( height: 20.h, ), - GestureDetector( - onTap: () { - showDialog( + if (viewModel.isOwner()) + GestureDetector( + onTap: () { + showDialog( context: context, builder: (_) => QRCodeScreen( - nft: viewModel.nft, - )); - }, - child: SvgPicture.asset( - SVGUtil.QR_ICON, + nft: viewModel.nft, + ), + ); + }, + child: SvgPicture.asset( + SVGUtil.QR_ICON, + height: 20.h, + ), + ) + else + const SizedBox(), + if (viewModel.isOwner()) + SizedBox( height: 20.h, - ), - ), - SizedBox( - height: 20.h, - ), + ) + else + const SizedBox(), GestureDetector( onTap: () async { final Size size = MediaQuery.of(context).size; @@ -647,6 +664,7 @@ class _OwnerBottomDrawerState extends State { /// BUY NFT BUTTON if (viewModel.showBuyNowButton(isPlatformAndroid: Platform.isAndroid)) BuyNFTButton( + key: const Key(kExpandedBuyButtonKeyValue), onTapped: () async { bool balancesFetchResult = true; if (viewModel.nft.price != kZeroInt) { @@ -714,7 +732,7 @@ class _OwnerBottomDrawerState extends State { ], ), SizedBox( - height: 5.h, + height: 3.h, ), RichText( text: TextSpan( diff --git a/wallet/lib/pages/purchase_item/purchase_item_view_model.dart b/wallet/lib/pages/purchase_item/purchase_item_view_model.dart index 5d3c662a7b..75286a7a6a 100644 --- a/wallet/lib/pages/purchase_item/purchase_item_view_model.dart +++ b/wallet/lib/pages/purchase_item/purchase_item_view_model.dart @@ -11,6 +11,7 @@ import 'package:pylons_wallet/ipc/models/sdk_ipc_response.dart'; import 'package:pylons_wallet/model/nft.dart'; import 'package:pylons_wallet/model/nft_ownership_history.dart'; import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/client/pylons/execution.pb.dart'; +import 'package:pylons_wallet/pages/detailed_asset_view/widgets/tab_fields.dart'; import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/services/repository/repository.dart'; import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart'; @@ -38,6 +39,11 @@ class PurchaseItemViewModel extends ChangeNotifier { bool get isViewingFullNft => _isViewingFullNft; + TabFields? selectedField; + bool isOwnershipExpanded = false; + bool isHistoryExpanded = false; + bool isDetailsExpanded = false; + set isViewingFullNft(bool value) { _isViewingFullNft = value; notifyListeners(); @@ -158,6 +164,50 @@ class PurchaseItemViewModel extends ChangeNotifier { showLoader.dismiss(); } + + void getWhichTabIsExpanded() { + isDetailsExpanded = false; + isHistoryExpanded = false; + isOwnershipExpanded = false; + + switch (selectedField) { + case TabFields.ownership: + isOwnershipExpanded = true; + notifyListeners(); + break; + case TabFields.history: + isHistoryExpanded = true; + notifyListeners(); + break; + case TabFields.details: + isDetailsExpanded = true; + notifyListeners(); + break; + default: + return; + } + } + + void closeExpansion() { + isDetailsExpanded = false; + isHistoryExpanded = false; + isOwnershipExpanded = false; + notifyListeners(); + } + + void onChangeTab(TabFields tab) { + if (tab == selectedField && isExpansionOpen()) { + closeExpansion(); + return; + } + + selectedField = tab; + getWhichTabIsExpanded(); + } + + bool isExpansionOpen() => isDetailsExpanded || isHistoryExpanded || isOwnershipExpanded; + + void initializePlayers(NFT nft) { switch (nft.assetType) { case AssetType.Audio: @@ -202,6 +252,8 @@ class PurchaseItemViewModel extends ChangeNotifier { } } + bool isOwner() => nft.ownerAddress == accountPublicInfo.publicAddress; + Future initializeVideoPlayer() async { videoPlayerHelper.initializeVideoPlayer(url: nft.url); videoPlayerController = videoPlayerHelper.getVideoPlayerController(); diff --git a/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart b/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart index fdc47db3b8..84ee286d62 100644 --- a/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart +++ b/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart @@ -2,11 +2,14 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:provider/provider.dart'; import 'package:pylons_wallet/main_prod.dart'; import 'package:pylons_wallet/model/nft.dart'; import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/pages/purchase_item/clipper/buy_now_clipper.dart'; +import 'package:pylons_wallet/pages/purchase_item/purchase_item_view_model.dart'; import 'package:pylons_wallet/utils/constants.dart'; +import 'package:pylons_wallet/utils/extension.dart'; import '../../../generated/locale_keys.g.dart'; @@ -16,7 +19,7 @@ class BuyNFTButton extends StatelessWidget { const BuyNFTButton({Key? key, required this.onTapped, required this.nft}) : super(key: key); - Widget getButtonContent(NFT nft) { + Widget getButtonContent(NFT nft, PurchaseItemViewModel viewModel) { if (double.parse(nft.price) == 0) { return Container( height: 60.h, @@ -54,42 +57,36 @@ class BuyNFTButton extends StatelessWidget { ); } return Container( - height: 60.h, + height: isTablet ? 65.h : 55.h, width: isTablet ? 160.w : 200.w, color: AppColors.kDarkRed.withOpacity(0.8), - child: Row( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - Container( - padding: EdgeInsets.only(left: 20.w), - alignment: Alignment.center, - child: Container( - height: 10.w, - width: 10.w, - decoration: BoxDecoration(shape: BoxShape.circle, color: AppColors.kButtonBuyNowColor), - ), - ), - const Spacer(), - Expanded( - flex: 4, - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: AutoSizeText( - "${LocaleKeys.buy_for.tr()} ${nft.ibcCoins.getCoinWithProperDenomination(nft.price)}", - style: TextStyle(color: Colors.white, fontSize: 16.sp), - maxLines: 1, - ), - ), - SizedBox( - width: 8.w, - ), - nft.ibcCoins.getAssets(), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + viewModel.nft.ibcCoins.getAssets(), + Text( + "${"buy_for".tr()} ${viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${viewModel.nft.ibcCoins.getTrailingAbbrev()} ", + style: TextStyle(color: Colors.white, fontSize: 16.sp, fontWeight: FontWeight.bold), + ), + ], ), - const Spacer(), + if (viewModel.nft.ibcCoins.name == kPylonDenom) + Padding( + padding: EdgeInsets.symmetric(horizontal: 18.0.w), + child: Text( + "(\$${viewModel.nft.ibcCoins.name.convertPylonsToUSD(viewModel.nft.price)} $kStripeUSD_ABR)", + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + ) + else + const SizedBox(), + SizedBox( + height: 2.0.h, + ) ], ), ); @@ -97,11 +94,12 @@ class BuyNFTButton extends StatelessWidget { @override Widget build(BuildContext context) { + final viewModel = context.read(); return ClipPath( clipper: BuyClipper(), child: InkWell( onTap: onTapped, - child: getButtonContent(nft), + child: getButtonContent(nft, viewModel), ), ); } diff --git a/wallet/lib/services/data_stores/local_data_store.dart b/wallet/lib/services/data_stores/local_data_store.dart index 578d64d6ff..abd1f3f146 100644 --- a/wallet/lib/services/data_stores/local_data_store.dart +++ b/wallet/lib/services/data_stores/local_data_store.dart @@ -8,12 +8,12 @@ import 'package:path_provider/path_provider.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pylons_wallet/model/pick_image_model.dart'; import 'package:pylons_wallet/model/transaction_failure_model.dart'; -import 'package:pylons_wallet/services/third_party_services/database.dart'; import 'package:pylons_wallet/utils/failure/failure.dart'; import 'package:pylons_wallet/utils/permission_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../../generated/locale_keys.g.dart'; +import '../third_party_services/database/database.dart'; abstract class LocalDataSource { /// This method save stripe token in the local storage diff --git a/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart b/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart new file mode 100644 index 0000000000..e8229410d0 --- /dev/null +++ b/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart @@ -0,0 +1,18 @@ +import 'package:floor/floor.dart'; + +import '../../../../model/favorites.dart'; + +@dao +abstract class FavoritesDao { + @Query('SELECT * FROM FavoritesModel ORDER BY dateTime DESC') + Future> getAll(); + + @insert + Future insertFavorites(FavoritesModel favoritesModel); + + @Query('DELETE FROM FavoritesModel WHERE id = :id') + Future delete(int id); + + @Query('DELETE * FROM FavoritesModel') + Future deleteAll(int id); +} diff --git a/wallet/lib/services/third_party_services/tx_manager_dao.dart b/wallet/lib/services/third_party_services/database/dao/tx_manager_dao.dart similarity index 100% rename from wallet/lib/services/third_party_services/tx_manager_dao.dart rename to wallet/lib/services/third_party_services/database/dao/tx_manager_dao.dart diff --git a/wallet/lib/services/third_party_services/database.dart b/wallet/lib/services/third_party_services/database/database.dart similarity index 56% rename from wallet/lib/services/third_party_services/database.dart rename to wallet/lib/services/third_party_services/database/database.dart index b8024e7a9e..8331271a9b 100644 --- a/wallet/lib/services/third_party_services/database.dart +++ b/wallet/lib/services/third_party_services/database/database.dart @@ -1,12 +1,13 @@ import 'dart:async'; import 'package:floor/floor.dart'; +import 'package:pylons_wallet/model/favorites.dart'; import 'package:pylons_wallet/model/transaction_failure_model.dart'; -import 'package:pylons_wallet/services/third_party_services/tx_manager_dao.dart'; +import 'package:pylons_wallet/services/third_party_services/database/dao/tx_manager_dao.dart'; import 'package:sqflite/sqflite.dart' as sqflite; part 'database.g.dart'; -@Database(version: 2, entities: [LocalTransactionModel]) +@Database(version: 2, entities: [LocalTransactionModel, FavoritesModel]) abstract class AppDatabase extends FloorDatabase { TxManagerDao get txManagerDao; } diff --git a/wallet/lib/services/third_party_services/database.g.dart b/wallet/lib/services/third_party_services/database/database.g.dart similarity index 92% rename from wallet/lib/services/third_party_services/database.g.dart rename to wallet/lib/services/third_party_services/database/database.g.dart index 5328061dc8..01615471ac 100644 --- a/wallet/lib/services/third_party_services/database.g.dart +++ b/wallet/lib/services/third_party_services/database/database.g.dart @@ -63,8 +63,11 @@ class _$AppDatabase extends AppDatabase { TxManagerDao? _txManagerDaoInstance; - Future open(String path, List migrations, - [Callback? callback]) async { + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { final databaseOptions = sqflite.OpenDatabaseOptions( version: 2, onConfigure: (database) async { @@ -83,6 +86,8 @@ class _$AppDatabase extends AppDatabase { onCreate: (database, version) async { await database.execute( 'CREATE TABLE IF NOT EXISTS `LocalTransactionModel` (`id` INTEGER, `transactionHash` TEXT NOT NULL, `transactionCurrency` TEXT NOT NULL, `transactionPrice` TEXT NOT NULL, `transactionType` TEXT NOT NULL, `transactionData` TEXT NOT NULL, `transactionDescription` TEXT NOT NULL, `status` TEXT NOT NULL, `dateTime` INTEGER NOT NULL, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE TABLE IF NOT EXISTS `FavoritesModel` (`dateTime` INTEGER NOT NULL, `id` TEXT NOT NULL, `cookbookId` TEXT NOT NULL, `type` TEXT NOT NULL, PRIMARY KEY (`dateTime`))'); await callback?.onCreate?.call(database, version); }, @@ -97,8 +102,10 @@ class _$AppDatabase extends AppDatabase { } class _$TxManagerDao extends TxManagerDao { - _$TxManagerDao(this.database, this.changeListener) - : _queryAdapter = QueryAdapter(database), + _$TxManagerDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), _localTransactionModelInsertionAdapter = InsertionAdapter( database, 'LocalTransactionModel', diff --git a/wallet/lib/utils/constants.dart b/wallet/lib/utils/constants.dart index d0bb7d3232..8b63a3f7da 100644 --- a/wallet/lib/utils/constants.dart +++ b/wallet/lib/utils/constants.dart @@ -80,7 +80,8 @@ const String kUniversalFontFamily = "UniversalSans"; const String kENV = 'ENV'; const String kLocal = 'local'; const String kPylo = 'pylo'; - +const kCID = "cid"; +const kIpfsCid = "IPFS CID"; const String kPylonCoinName = "pylon"; const String kUSDDenom = "ustripeusd"; const String kUSD = "stripeusd"; @@ -168,6 +169,7 @@ const String kNone = "None"; const String kEmoney = "eMoney Euro"; const String kPylons = "Pylons"; const String kDollar = "U.S. Dollar"; +const String kPoints = "Points"; const String kAtom = "ATOM"; const String kEthereum = "Ethereum"; diff --git a/wallet/lib/utils/dependency_injection/dependency_injection.dart b/wallet/lib/utils/dependency_injection/dependency_injection.dart index 71ecf8fd2b..0cdfccae67 100644 --- a/wallet/lib/utils/dependency_injection/dependency_injection.dart +++ b/wallet/lib/utils/dependency_injection/dependency_injection.dart @@ -32,7 +32,6 @@ import 'package:pylons_wallet/services/repository/repository.dart'; import 'package:pylons_wallet/services/third_party_services/analytics_helper.dart'; import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart'; import 'package:pylons_wallet/services/third_party_services/crashlytics_helper.dart'; -import 'package:pylons_wallet/services/third_party_services/database.dart'; import 'package:pylons_wallet/services/third_party_services/firestore_helper.dart'; import 'package:pylons_wallet/services/third_party_services/network_info.dart'; import 'package:pylons_wallet/services/third_party_services/remote_config_service/remote_config_service.dart'; @@ -66,6 +65,8 @@ import 'package:transaction_signing_gateway/storage/flutter_secure_storage_data_ import 'package:transaction_signing_gateway/storage/shared_prefs_plain_data_store.dart'; import 'package:video_player/video_player.dart'; +import '../../services/third_party_services/database/database.dart'; + final sl = GetIt.instance; /// This method is used for initializing the dependencies diff --git a/wallet/lib/utils/read_more.dart b/wallet/lib/utils/read_more.dart index 286a85219b..857b2b08f3 100644 --- a/wallet/lib/utils/read_more.dart +++ b/wallet/lib/utils/read_more.dart @@ -1,8 +1,11 @@ library readmore; +import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'constants.dart'; + enum TrimMode { Length, Line, @@ -90,20 +93,15 @@ class ReadMoreTextState extends State { effectiveTextStyle = defaultTextStyle.style.merge(widget.style); } - final textAlign = - widget.textAlign ?? defaultTextStyle.textAlign ?? TextAlign.start; + final textAlign = widget.textAlign ?? defaultTextStyle.textAlign ?? TextAlign.start; final textDirection = widget.textDirection ?? Directionality.of(context); - final textScaleFactor = - widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context); + final textScaleFactor = widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context); final overflow = defaultTextStyle.overflow; final locale = widget.locale ?? Localizations.maybeLocaleOf(context); - final colorClickableText = - widget.colorClickableText ?? Theme.of(context).colorScheme.secondary; - final defaultLessStyle = widget.lessStyle ?? - effectiveTextStyle?.copyWith(color: colorClickableText); - final defaultMoreStyle = widget.moreStyle ?? - effectiveTextStyle?.copyWith(color: colorClickableText); + final colorClickableText = widget.colorClickableText ?? Theme.of(context).colorScheme.secondary; + final defaultLessStyle = widget.lessStyle ?? effectiveTextStyle?.copyWith(color: colorClickableText); + final defaultMoreStyle = widget.moreStyle ?? effectiveTextStyle?.copyWith(color: colorClickableText); final defaultDelimiterStyle = widget.delimiterStyle ?? effectiveTextStyle; final TextSpan link = TextSpan( @@ -163,9 +161,7 @@ class ReadMoreTextState extends State { if (linkSize.width < maxWidth) { final readMoreSize = linkSize.width + delimiterSize.width; final pos = textPainter.getPositionForOffset(Offset( - textDirection == TextDirection.rtl - ? readMoreSize - : textSize.width - readMoreSize, + textDirection == TextDirection.rtl ? readMoreSize : textSize.width - readMoreSize, textSize.height, )); endIndex = textPainter.getOffsetBefore(pos.offset) ?? 0; @@ -183,9 +179,7 @@ class ReadMoreTextState extends State { if (widget.trimLength < widget.data.length) { textSpan = TextSpan( style: effectiveTextStyle, - text: _readMore - ? widget.data.substring(0, widget.trimLength) - : widget.data, + text: _readMore ? widget.data.substring(0, widget.trimLength) : widget.data, children: [delimiter, link], ); } else { @@ -199,10 +193,7 @@ class ReadMoreTextState extends State { if (textPainter.didExceedMaxLines) { textSpan = TextSpan( style: effectiveTextStyle, - text: _readMore - ? widget.data.substring(0, endIndex) + - (linkLongerThanLine ? _kLineSeparator : '') - : widget.data, + text: _readMore ? widget.data.substring(0, endIndex) + (linkLongerThanLine ? _kLineSeparator : '') : widget.data, children: [delimiter, link], ); } else { @@ -213,15 +204,16 @@ class ReadMoreTextState extends State { } break; default: - throw Exception( - 'TrimMode type: ${widget.trimMode} is not supported'); + throw Exception('TrimMode type: ${widget.trimMode} is not supported'); } - return RichText( + return AutoSizeText.rich( + textSpan, textAlign: textAlign, textDirection: textDirection, - textScaleFactor: textScaleFactor, - text: textSpan, + style: TextStyle(color: AppColors.kWhite), + maxLines: 4, + minFontSize: 10, ); }, ); diff --git a/wallet/pubspec.yaml b/wallet/pubspec.yaml index 920efdd37b..91651a1d71 100644 --- a/wallet/pubspec.yaml +++ b/wallet/pubspec.yaml @@ -97,7 +97,7 @@ dependencies: dev_dependencies: - build_runner: ^2.2.1 + build_runner: ^2.3.2 # # Revert it for making autogenerated code for database # floor_generator: 1.3.0 flutter_test: diff --git a/wallet/test/mocks/mock_constants.dart b/wallet/test/mocks/mock_constants.dart index 00e4adeed6..0d0ac6149e 100644 --- a/wallet/test/mocks/mock_constants.dart +++ b/wallet/test/mocks/mock_constants.dart @@ -334,3 +334,4 @@ bool MOCK_CAMERA_CONTROLS = false; bool MOCK_SHOW_LOADER_TRUE = true; bool MOCK_SHOW_LOADER_FALSE = false; String MOCK_DYNAMIC_LINK = "https://pylons.page.link/i89m9Qxw7fYjW2RS8"; +const MOCK_BUY_BUTTON_KEY_VALUE = "buy_button_key"; diff --git a/wallet/test/mocks/mock_repository.dart b/wallet/test/mocks/mock_repository.dart index eec063dcba..d6402ea7c8 100644 --- a/wallet/test/mocks/mock_repository.dart +++ b/wallet/test/mocks/mock_repository.dart @@ -537,8 +537,7 @@ class MockRepository extends Repository { @override Future> logPurchaseItem({required String recipeId, required String recipeName, required String author, required double purchasePrice}) { - // TODO: implement logPurchaseItem - throw UnimplementedError(); + return Future.value(const Right(true)); } @override diff --git a/wallet/test/mocks/purchase_item_view_model.mocks.dart b/wallet/test/mocks/purchase_item_view_model.mocks.dart new file mode 100644 index 0000000000..de15acbe3b --- /dev/null +++ b/wallet/test/mocks/purchase_item_view_model.mocks.dart @@ -0,0 +1,999 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in pylons_wallet/test/widget_testing/components/buttons/nft_buy_button_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i6; +import 'dart:ui' as _i20; + +import 'package:dartz/dartz.dart' as _i11; +import 'package:flutter/cupertino.dart' as _i7; +import 'package:mockito/mockito.dart' as _i1; +import 'package:pylons_wallet/ipc/models/sdk_ipc_response.dart' as _i10; +import 'package:pylons_wallet/model/nft.dart' as _i9; +import 'package:pylons_wallet/model/nft_ownership_history.dart' as _i18; +import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/client/pylons/execution.pb.dart' + as _i19; +import 'package:pylons_wallet/pages/detailed_asset_view/widgets/tab_fields.dart' + as _i13; +import 'package:pylons_wallet/pages/owner_purchase_view_common/button_state.dart' + as _i17; +import 'package:pylons_wallet/pages/owner_purchase_view_common/progress_bar_state.dart' + as _i16; +import 'package:pylons_wallet/pages/purchase_item/purchase_item_view_model.dart' + as _i12; +import 'package:pylons_wallet/services/repository/repository.dart' as _i4; +import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart' + as _i2; +import 'package:pylons_wallet/services/third_party_services/share_helper.dart' + as _i5; +import 'package:pylons_wallet/services/third_party_services/video_player_helper.dart' + as _i3; +import 'package:pylons_wallet/stores/wallet_store.dart' as _i8; +import 'package:transaction_signing_gateway/transaction_signing_gateway.dart' + as _i14; +import 'package:video_player/video_player.dart' as _i15; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeAudioPlayerHelper_0 extends _i1.SmartFake + implements _i2.AudioPlayerHelper { + _FakeAudioPlayerHelper_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeVideoPlayerHelper_1 extends _i1.SmartFake + implements _i3.VideoPlayerHelper { + _FakeVideoPlayerHelper_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRepository_2 extends _i1.SmartFake implements _i4.Repository { + _FakeRepository_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeShareHelper_3 extends _i1.SmartFake implements _i5.ShareHelper { + _FakeShareHelper_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStreamSubscription_4 extends _i1.SmartFake + implements _i6.StreamSubscription { + _FakeStreamSubscription_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeValueNotifier_5 extends _i1.SmartFake + implements _i7.ValueNotifier { + _FakeValueNotifier_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeWalletsStore_6 extends _i1.SmartFake implements _i8.WalletsStore { + _FakeWalletsStore_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeNFT_7 extends _i1.SmartFake implements _i9.NFT { + _FakeNFT_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSdkIpcResponse_8 extends _i1.SmartFake + implements _i10.SdkIpcResponse { + _FakeSdkIpcResponse_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeEither_9 extends _i1.SmartFake implements _i11.Either { + _FakeEither_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [PurchaseItemViewModel]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockPurchaseItemViewModel extends _i1.Mock + implements _i12.PurchaseItemViewModel { + @override + set selectedField(_i13.TabFields? _selectedField) => super.noSuchMethod( + Invocation.setter( + #selectedField, + _selectedField, + ), + returnValueForMissingStub: null, + ); + @override + bool get isOwnershipExpanded => (super.noSuchMethod( + Invocation.getter(#isOwnershipExpanded), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isOwnershipExpanded(bool? _isOwnershipExpanded) => super.noSuchMethod( + Invocation.setter( + #isOwnershipExpanded, + _isOwnershipExpanded, + ), + returnValueForMissingStub: null, + ); + @override + bool get isHistoryExpanded => (super.noSuchMethod( + Invocation.getter(#isHistoryExpanded), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isHistoryExpanded(bool? _isHistoryExpanded) => super.noSuchMethod( + Invocation.setter( + #isHistoryExpanded, + _isHistoryExpanded, + ), + returnValueForMissingStub: null, + ); + @override + bool get isDetailsExpanded => (super.noSuchMethod( + Invocation.getter(#isDetailsExpanded), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isDetailsExpanded(bool? _isDetailsExpanded) => super.noSuchMethod( + Invocation.setter( + #isDetailsExpanded, + _isDetailsExpanded, + ), + returnValueForMissingStub: null, + ); + @override + bool get isUrlLoaded => (super.noSuchMethod( + Invocation.getter(#isUrlLoaded), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isUrlLoaded(bool? _isUrlLoaded) => super.noSuchMethod( + Invocation.setter( + #isUrlLoaded, + _isUrlLoaded, + ), + returnValueForMissingStub: null, + ); + @override + _i2.AudioPlayerHelper get audioPlayerHelper => (super.noSuchMethod( + Invocation.getter(#audioPlayerHelper), + returnValue: _FakeAudioPlayerHelper_0( + this, + Invocation.getter(#audioPlayerHelper), + ), + returnValueForMissingStub: _FakeAudioPlayerHelper_0( + this, + Invocation.getter(#audioPlayerHelper), + ), + ) as _i2.AudioPlayerHelper); + @override + _i3.VideoPlayerHelper get videoPlayerHelper => (super.noSuchMethod( + Invocation.getter(#videoPlayerHelper), + returnValue: _FakeVideoPlayerHelper_1( + this, + Invocation.getter(#videoPlayerHelper), + ), + returnValueForMissingStub: _FakeVideoPlayerHelper_1( + this, + Invocation.getter(#videoPlayerHelper), + ), + ) as _i3.VideoPlayerHelper); + @override + _i4.Repository get repository => (super.noSuchMethod( + Invocation.getter(#repository), + returnValue: _FakeRepository_2( + this, + Invocation.getter(#repository), + ), + returnValueForMissingStub: _FakeRepository_2( + this, + Invocation.getter(#repository), + ), + ) as _i4.Repository); + @override + _i5.ShareHelper get shareHelper => (super.noSuchMethod( + Invocation.getter(#shareHelper), + returnValue: _FakeShareHelper_3( + this, + Invocation.getter(#shareHelper), + ), + returnValueForMissingStub: _FakeShareHelper_3( + this, + Invocation.getter(#shareHelper), + ), + ) as _i5.ShareHelper); + @override + bool get darkMode => (super.noSuchMethod( + Invocation.getter(#darkMode), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set darkMode(bool? _darkMode) => super.noSuchMethod( + Invocation.setter( + #darkMode, + _darkMode, + ), + returnValueForMissingStub: null, + ); + + set accountPublicInfo(_i14.AccountPublicInfo? _accountPublicInfo) => + super.noSuchMethod( + Invocation.setter( + #accountPublicInfo, + _accountPublicInfo, + ), + returnValueForMissingStub: null, + ); + @override + _i6.StreamSubscription get playerStateSubscription => + (super.noSuchMethod( + Invocation.getter(#playerStateSubscription), + returnValue: _FakeStreamSubscription_4( + this, + Invocation.getter(#playerStateSubscription), + ), + returnValueForMissingStub: _FakeStreamSubscription_4( + this, + Invocation.getter(#playerStateSubscription), + ), + ) as _i6.StreamSubscription); + @override + set playerStateSubscription( + _i6.StreamSubscription? _playerStateSubscription) => + super.noSuchMethod( + Invocation.setter( + #playerStateSubscription, + _playerStateSubscription, + ), + returnValueForMissingStub: null, + ); + @override + _i6.StreamSubscription get positionStreamSubscription => + (super.noSuchMethod( + Invocation.getter(#positionStreamSubscription), + returnValue: _FakeStreamSubscription_4( + this, + Invocation.getter(#positionStreamSubscription), + ), + returnValueForMissingStub: _FakeStreamSubscription_4( + this, + Invocation.getter(#positionStreamSubscription), + ), + ) as _i6.StreamSubscription); + @override + set positionStreamSubscription( + _i6.StreamSubscription? _positionStreamSubscription) => + super.noSuchMethod( + Invocation.setter( + #positionStreamSubscription, + _positionStreamSubscription, + ), + returnValueForMissingStub: null, + ); + @override + _i6.StreamSubscription get bufferPositionSubscription => + (super.noSuchMethod( + Invocation.getter(#bufferPositionSubscription), + returnValue: _FakeStreamSubscription_4( + this, + Invocation.getter(#bufferPositionSubscription), + ), + returnValueForMissingStub: _FakeStreamSubscription_4( + this, + Invocation.getter(#bufferPositionSubscription), + ), + ) as _i6.StreamSubscription); + @override + set bufferPositionSubscription( + _i6.StreamSubscription? _bufferPositionSubscription) => + super.noSuchMethod( + Invocation.setter( + #bufferPositionSubscription, + _bufferPositionSubscription, + ), + returnValueForMissingStub: null, + ); + @override + _i6.StreamSubscription get durationStreamSubscription => + (super.noSuchMethod( + Invocation.getter(#durationStreamSubscription), + returnValue: _FakeStreamSubscription_4( + this, + Invocation.getter(#durationStreamSubscription), + ), + returnValueForMissingStub: _FakeStreamSubscription_4( + this, + Invocation.getter(#durationStreamSubscription), + ), + ) as _i6.StreamSubscription); + @override + set durationStreamSubscription( + _i6.StreamSubscription? _durationStreamSubscription) => + super.noSuchMethod( + Invocation.setter( + #durationStreamSubscription, + _durationStreamSubscription, + ), + returnValueForMissingStub: null, + ); + @override + set videoPlayerController( + _i15.VideoPlayerController? _videoPlayerController) => + super.noSuchMethod( + Invocation.setter( + #videoPlayerController, + _videoPlayerController, + ), + returnValueForMissingStub: null, + ); + @override + _i7.ValueNotifier<_i16.ProgressBarState> get progressNotifier => + (super.noSuchMethod( + Invocation.getter(#progressNotifier), + returnValue: _FakeValueNotifier_5<_i16.ProgressBarState>( + this, + Invocation.getter(#progressNotifier), + ), + returnValueForMissingStub: _FakeValueNotifier_5<_i16.ProgressBarState>( + this, + Invocation.getter(#progressNotifier), + ), + ) as _i7.ValueNotifier<_i16.ProgressBarState>); + @override + set progressNotifier( + _i7.ValueNotifier<_i16.ProgressBarState>? _progressNotifier) => + super.noSuchMethod( + Invocation.setter( + #progressNotifier, + _progressNotifier, + ), + returnValueForMissingStub: null, + ); + @override + _i7.ValueNotifier<_i17.ButtonState> get buttonNotifier => (super.noSuchMethod( + Invocation.getter(#buttonNotifier), + returnValue: _FakeValueNotifier_5<_i17.ButtonState>( + this, + Invocation.getter(#buttonNotifier), + ), + returnValueForMissingStub: _FakeValueNotifier_5<_i17.ButtonState>( + this, + Invocation.getter(#buttonNotifier), + ), + ) as _i7.ValueNotifier<_i17.ButtonState>); + @override + set buttonNotifier(_i7.ValueNotifier<_i17.ButtonState>? _buttonNotifier) => + super.noSuchMethod( + Invocation.setter( + #buttonNotifier, + _buttonNotifier, + ), + returnValueForMissingStub: null, + ); + @override + _i8.WalletsStore get walletsStore => (super.noSuchMethod( + Invocation.getter(#walletsStore), + returnValue: _FakeWalletsStore_6( + this, + Invocation.getter(#walletsStore), + ), + returnValueForMissingStub: _FakeWalletsStore_6( + this, + Invocation.getter(#walletsStore), + ), + ) as _i8.WalletsStore); + @override + set walletsStore(_i8.WalletsStore? _walletsStore) => super.noSuchMethod( + Invocation.setter( + #walletsStore, + _walletsStore, + ), + returnValueForMissingStub: null, + ); + @override + List get hashtagList => (super.noSuchMethod( + Invocation.getter(#hashtagList), + returnValue: [], + returnValueForMissingStub: [], + ) as List); + @override + set hashtagList(List? _hashtagList) => super.noSuchMethod( + Invocation.setter( + #hashtagList, + _hashtagList, + ), + returnValueForMissingStub: null, + ); + @override + List<_i18.NftOwnershipHistory> get nftOwnershipHistoryList => + (super.noSuchMethod( + Invocation.getter(#nftOwnershipHistoryList), + returnValue: <_i18.NftOwnershipHistory>[], + returnValueForMissingStub: <_i18.NftOwnershipHistory>[], + ) as List<_i18.NftOwnershipHistory>); + @override + set nftOwnershipHistoryList( + List<_i18.NftOwnershipHistory>? _nftOwnershipHistoryList) => + super.noSuchMethod( + Invocation.setter( + #nftOwnershipHistoryList, + _nftOwnershipHistoryList, + ), + returnValueForMissingStub: null, + ); + @override + bool get isViewingFullNft => (super.noSuchMethod( + Invocation.getter(#isViewingFullNft), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isViewingFullNft(bool? value) => super.noSuchMethod( + Invocation.setter( + #isViewingFullNft, + value, + ), + returnValueForMissingStub: null, + ); + @override + bool get isVideoLoading => (super.noSuchMethod( + Invocation.getter(#isVideoLoading), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isVideoLoading(bool? value) => super.noSuchMethod( + Invocation.setter( + #isVideoLoading, + value, + ), + returnValueForMissingStub: null, + ); + @override + int get likesCount => (super.noSuchMethod( + Invocation.getter(#likesCount), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + @override + set likesCount(int? value) => super.noSuchMethod( + Invocation.setter( + #likesCount, + value, + ), + returnValueForMissingStub: null, + ); + @override + bool get likedByMe => (super.noSuchMethod( + Invocation.getter(#likedByMe), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set likedByMe(bool? value) => super.noSuchMethod( + Invocation.setter( + #likedByMe, + value, + ), + returnValueForMissingStub: null, + ); + @override + bool get isLiking => (super.noSuchMethod( + Invocation.getter(#isLiking), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set isLiking(bool? value) => super.noSuchMethod( + Invocation.setter( + #isLiking, + value, + ), + returnValueForMissingStub: null, + ); + @override + int get viewsCount => (super.noSuchMethod( + Invocation.getter(#viewsCount), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + @override + set viewsCount(int? value) => super.noSuchMethod( + Invocation.setter( + #viewsCount, + value, + ), + returnValueForMissingStub: null, + ); + @override + String get videoLoadingError => (super.noSuchMethod( + Invocation.getter(#videoLoadingError), + returnValue: '', + returnValueForMissingStub: '', + ) as String); + @override + set videoLoadingError(String? value) => super.noSuchMethod( + Invocation.setter( + #videoLoadingError, + value, + ), + returnValueForMissingStub: null, + ); + @override + bool get collapsed => (super.noSuchMethod( + Invocation.getter(#collapsed), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + set collapsed(bool? value) => super.noSuchMethod( + Invocation.setter( + #collapsed, + value, + ), + returnValueForMissingStub: null, + ); + @override + _i9.NFT get nft => (super.noSuchMethod( + Invocation.getter(#nft), + returnValue: _FakeNFT_7( + this, + Invocation.getter(#nft), + ), + returnValueForMissingStub: _FakeNFT_7( + this, + Invocation.getter(#nft), + ), + ) as _i9.NFT); + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + void setNFT(_i9.NFT? nft) => super.noSuchMethod( + Invocation.method( + #setNFT, + [nft], + ), + returnValueForMissingStub: null, + ); + @override + void initializeData() => super.noSuchMethod( + Invocation.method( + #initializeData, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i6.Future<_i10.SdkIpcResponse<_i19.Execution>> paymentForRecipe() => + (super.noSuchMethod( + Invocation.method( + #paymentForRecipe, + [], + ), + returnValue: _i6.Future<_i10.SdkIpcResponse<_i19.Execution>>.value( + _FakeSdkIpcResponse_8<_i19.Execution>( + this, + Invocation.method( + #paymentForRecipe, + [], + ), + )), + returnValueForMissingStub: + _i6.Future<_i10.SdkIpcResponse<_i19.Execution>>.value( + _FakeSdkIpcResponse_8<_i19.Execution>( + this, + Invocation.method( + #paymentForRecipe, + [], + ), + )), + ) as _i6.Future<_i10.SdkIpcResponse<_i19.Execution>>); + @override + _i6.Future paymentForTrade() => (super.noSuchMethod( + Invocation.method( + #paymentForTrade, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + void getWhichTabIsExpanded() => super.noSuchMethod( + Invocation.method( + #getWhichTabIsExpanded, + [], + ), + returnValueForMissingStub: null, + ); + @override + void closeExpansion() => super.noSuchMethod( + Invocation.method( + #closeExpansion, + [], + ), + returnValueForMissingStub: null, + ); + @override + void onChangeTab(_i13.TabFields? tab) => super.noSuchMethod( + Invocation.method( + #onChangeTab, + [tab], + ), + returnValueForMissingStub: null, + ); + @override + bool isExpansionOpen() => (super.noSuchMethod( + Invocation.method( + #isExpansionOpen, + [], + ), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + void initializePlayers(_i9.NFT? nft) => super.noSuchMethod( + Invocation.method( + #initializePlayers, + [nft], + ), + returnValueForMissingStub: null, + ); + @override + void destroyPlayers() => super.noSuchMethod( + Invocation.method( + #destroyPlayers, + [], + ), + returnValueForMissingStub: null, + ); + @override + void pauseMedia() => super.noSuchMethod( + Invocation.method( + #pauseMedia, + [], + ), + returnValueForMissingStub: null, + ); + @override + bool isOwner() => (super.noSuchMethod( + Invocation.method( + #isOwner, + [], + ), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + _i6.Future initializeVideoPlayer() => (super.noSuchMethod( + Invocation.method( + #initializeVideoPlayer, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + _i6.Future delayLoading() => (super.noSuchMethod( + Invocation.method( + #delayLoading, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + void playVideo() => super.noSuchMethod( + Invocation.method( + #playVideo, + [], + ), + returnValueForMissingStub: null, + ); + @override + void pauseVideo() => super.noSuchMethod( + Invocation.method( + #pauseVideo, + [], + ), + returnValueForMissingStub: null, + ); + @override + void seekVideo(Duration? position) => super.noSuchMethod( + Invocation.method( + #seekVideo, + [position], + ), + returnValueForMissingStub: null, + ); + @override + void disposeVideoController() => super.noSuchMethod( + Invocation.method( + #disposeVideoController, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i6.Future nftDataInit({ + required String? recipeId, + required String? cookBookId, + required String? itemId, + }) => + (super.noSuchMethod( + Invocation.method( + #nftDataInit, + [], + { + #recipeId: recipeId, + #cookBookId: cookBookId, + #itemId: itemId, + }, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + _i6.Future updateLikeStatus({ + required String? recipeId, + required String? cookBookID, + }) => + (super.noSuchMethod( + Invocation.method( + #updateLikeStatus, + [], + { + #recipeId: recipeId, + #cookBookID: cookBookID, + }, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + _i6.Future initializeAudioPlayer() => (super.noSuchMethod( + Invocation.method( + #initializeAudioPlayer, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + void playAudio() => super.noSuchMethod( + Invocation.method( + #playAudio, + [], + ), + returnValueForMissingStub: null, + ); + @override + void pauseAudio() => super.noSuchMethod( + Invocation.method( + #pauseAudio, + [], + ), + returnValueForMissingStub: null, + ); + @override + void seekAudio(Duration? position) => super.noSuchMethod( + Invocation.method( + #seekAudio, + [position], + ), + returnValueForMissingStub: null, + ); + @override + void disposeAudioController() => super.noSuchMethod( + Invocation.method( + #disposeAudioController, + [], + ), + returnValueForMissingStub: null, + ); + @override + void toHashtagList() => super.noSuchMethod( + Invocation.method( + #toHashtagList, + [], + ), + returnValueForMissingStub: null, + ); + @override + void toChangeCollapse() => super.noSuchMethod( + Invocation.method( + #toChangeCollapse, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i6.Future shareNFTLink({required _i20.Size? size}) => + (super.noSuchMethod( + Invocation.method( + #shareNFTLink, + [], + {#size: size}, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + _i6.Future<_i11.Either> shouldShowSwipeToBuy({ + required String? selectedDenom, + required double? requiredAmount, + }) => + (super.noSuchMethod( + Invocation.method( + #shouldShowSwipeToBuy, + [], + { + #selectedDenom: selectedDenom, + #requiredAmount: requiredAmount, + }, + ), + returnValue: _i6.Future<_i11.Either>.value( + _FakeEither_9( + this, + Invocation.method( + #shouldShowSwipeToBuy, + [], + { + #selectedDenom: selectedDenom, + #requiredAmount: requiredAmount, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i11.Either>.value( + _FakeEither_9( + this, + Invocation.method( + #shouldShowSwipeToBuy, + [], + { + #selectedDenom: selectedDenom, + #requiredAmount: requiredAmount, + }, + ), + )), + ) as _i6.Future<_i11.Either>); + @override + void addLogForCart() => super.noSuchMethod( + Invocation.method( + #addLogForCart, + [], + ), + returnValueForMissingStub: null, + ); + @override + bool isRealWorldPaymentAllowed({required bool? isPlatformAndroid}) => + (super.noSuchMethod( + Invocation.method( + #isRealWorldPaymentAllowed, + [], + {#isPlatformAndroid: isPlatformAndroid}, + ), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + bool showBuyNowButton({required bool? isPlatformAndroid}) => + (super.noSuchMethod( + Invocation.method( + #showBuyNowButton, + [], + {#isPlatformAndroid: isPlatformAndroid}, + ), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override + void logEvent() => super.noSuchMethod( + Invocation.method( + #logEvent, + [], + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} diff --git a/wallet/test/unit_testing/pages/purchase_item/purchase_item_view_model_test.mocks.dart b/wallet/test/unit_testing/pages/purchase_item/purchase_item_view_model_test.mocks.dart index 6d11a098e4..f854efd6d0 100644 --- a/wallet/test/unit_testing/pages/purchase_item/purchase_item_view_model_test.mocks.dart +++ b/wallet/test/unit_testing/pages/purchase_item/purchase_item_view_model_test.mocks.dart @@ -8,45 +8,36 @@ import 'dart:async' as _i8; import 'package:dartz/dartz.dart' as _i2; import 'package:fixnum/fixnum.dart' as _i11; import 'package:in_app_purchase/in_app_purchase.dart' as _i27; -import 'package:internet_connection_checker/internet_connection_checker.dart' - as _i26; +import 'package:internet_connection_checker/internet_connection_checker.dart' as _i26; import 'package:local_auth/local_auth.dart' as _i22; import 'package:mobx/mobx.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; import 'package:pylons_wallet/ipc/models/sdk_ipc_response.dart' as _i3; import 'package:pylons_wallet/model/balance.dart' as _i14; -import 'package:pylons_wallet/model/execution_list_by_recipe_response.dart' - as _i15; +import 'package:pylons_wallet/model/execution_list_by_recipe_response.dart' as _i15; import 'package:pylons_wallet/model/export.dart' as _i16; import 'package:pylons_wallet/model/nft.dart' as _i29; import 'package:pylons_wallet/model/nft_ownership_history.dart' as _i23; import 'package:pylons_wallet/model/notification_message.dart' as _i28; import 'package:pylons_wallet/model/pick_image_model.dart' as _i21; -import 'package:pylons_wallet/model/stripe_get_login_based_address.dart' - as _i19; +import 'package:pylons_wallet/model/stripe_get_login_based_address.dart' as _i19; import 'package:pylons_wallet/model/stripe_loginlink_request.dart' as _i18; import 'package:pylons_wallet/model/stripe_loginlink_response.dart' as _i17; import 'package:pylons_wallet/model/transaction.dart' as _i24; import 'package:pylons_wallet/model/transaction_failure_model.dart' as _i32; import 'package:pylons_wallet/model/wallet_creation_model.dart' as _i31; -import 'package:pylons_wallet/modules/cosmos.tx.v1beta1/module/client/cosmos/base/abci/v1beta1/abci.pb.dart' - as _i4; -import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/export.dart' - as _i10; -import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart' - as _i33; -import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_trace_model.dart' - as _i20; -import 'package:pylons_wallet/services/data_stores/remote_data_store.dart' - as _i12; +import 'package:pylons_wallet/modules/cosmos.tx.v1beta1/module/client/cosmos/base/abci/v1beta1/abci.pb.dart' as _i4; +import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/export.dart' as _i10; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart' as _i33; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_trace_model.dart' as _i20; +import 'package:pylons_wallet/services/data_stores/remote_data_store.dart' as _i12; import 'package:pylons_wallet/services/repository/repository.dart' as _i13; import 'package:pylons_wallet/stores/models/transaction_response.dart' as _i30; import 'package:pylons_wallet/stores/wallet_store.dart' as _i7; import 'package:pylons_wallet/utils/backup/common/backup_model.dart' as _i25; import 'package:pylons_wallet/utils/enums.dart' as _i34; import 'package:pylons_wallet/utils/failure/failure.dart' as _i9; -import 'package:transaction_signing_gateway/transaction_signing_gateway.dart' - as _i6; +import 'package:transaction_signing_gateway/transaction_signing_gateway.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -69,8 +60,7 @@ class _FakeEither_0 extends _i1.SmartFake implements _i2.Either { ); } -class _FakeSdkIpcResponse_1 extends _i1.SmartFake - implements _i3.SdkIpcResponse { +class _FakeSdkIpcResponse_1 extends _i1.SmartFake implements _i3.SdkIpcResponse { _FakeSdkIpcResponse_1( Object parent, Invocation parentInvocation, @@ -100,8 +90,7 @@ class _FakeObservable_3 extends _i1.SmartFake implements _i5.Observable { ); } -class _FakeAccountPublicInfo_4 extends _i1.SmartFake - implements _i6.AccountPublicInfo { +class _FakeAccountPublicInfo_4 extends _i1.SmartFake implements _i6.AccountPublicInfo { _FakeAccountPublicInfo_4( Object parent, Invocation parentInvocation, @@ -132,9 +121,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { userName, ], ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>.value( - _FakeEither_0<_i9.Failure, _i6.AccountPublicInfo>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>.value(_FakeEither_0<_i9.Failure, _i6.AccountPublicInfo>( this, Invocation.method( #importAlanWallet, @@ -146,15 +133,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>); @override - _i8.Future<_i3.SdkIpcResponse> createCookbook( - Map? json) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> createCookbook(Map? json) => (super.noSuchMethod( Invocation.method( #createCookbook, [json], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #createCookbook, @@ -163,15 +147,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> createRecipe( - Map? json) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> createRecipe(Map? json) => (super.noSuchMethod( Invocation.method( #createRecipe, [json], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #createRecipe, @@ -180,15 +161,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse<_i10.Execution>> executeRecipe( - Map? json) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse<_i10.Execution>> executeRecipe(Map? json) => (super.noSuchMethod( Invocation.method( #executeRecipe, [json], ), - returnValue: _i8.Future<_i3.SdkIpcResponse<_i10.Execution>>.value( - _FakeSdkIpcResponse_1<_i10.Execution>( + returnValue: _i8.Future<_i3.SdkIpcResponse<_i10.Execution>>.value(_FakeSdkIpcResponse_1<_i10.Execution>( this, Invocation.method( #executeRecipe, @@ -197,15 +175,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse<_i10.Execution>>); @override - _i8.Future<_i3.SdkIpcResponse> createTrade( - Map? json) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> createTrade(Map? json) => (super.noSuchMethod( Invocation.method( #createTrade, [json], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #createTrade, @@ -214,15 +189,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> fulfillTrade( - Map? json) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> fulfillTrade(Map? json) => (super.noSuchMethod( Invocation.method( #fulfillTrade, [json], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #fulfillTrade, @@ -245,8 +217,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i4.TxResponse>); @override - _i8.Future<_i10.Cookbook?> getCookbookById(String? cookbookID) => - (super.noSuchMethod( + _i8.Future<_i10.Cookbook?> getCookbookById(String? cookbookID) => (super.noSuchMethod( Invocation.method( #getCookbookById, [cookbookID], @@ -254,8 +225,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future<_i10.Cookbook?>.value(), ) as _i8.Future<_i10.Cookbook?>); @override - _i8.Future> getCookbooksByCreator(String? creator) => - (super.noSuchMethod( + _i8.Future> getCookbooksByCreator(String? creator) => (super.noSuchMethod( Invocation.method( #getCookbooksByCreator, [creator], @@ -271,8 +241,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future<_i10.Trade?>.value(), ) as _i8.Future<_i10.Trade?>); @override - _i8.Future> getTrades(String? creator) => - (super.noSuchMethod( + _i8.Future> getTrades(String? creator) => (super.noSuchMethod( Invocation.method( #getTrades, [creator], @@ -292,8 +261,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { recipeID, ], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Recipe>>.value( - _FakeEither_0<_i9.Failure, _i10.Recipe>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Recipe>>.value(_FakeEither_0<_i9.Failure, _i10.Recipe>( this, Invocation.method( #getRecipe, @@ -320,8 +288,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future<_i10.Item?>.value(), ) as _i8.Future<_i10.Item?>); @override - _i8.Future> getItemsByOwner(String? owner) => - (super.noSuchMethod( + _i8.Future> getItemsByOwner(String? owner) => (super.noSuchMethod( Invocation.method( #getItemsByOwner, [owner], @@ -329,8 +296,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future>.value(<_i10.Item>[]), ) as _i8.Future>); @override - _i8.Future getAccountNameByAddress(String? address) => - (super.noSuchMethod( + _i8.Future getAccountNameByAddress(String? address) => (super.noSuchMethod( Invocation.method( #getAccountNameByAddress, [address], @@ -338,8 +304,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future.value(''), ) as _i8.Future); @override - _i8.Future getAccountAddressByName(String? username) => - (super.noSuchMethod( + _i8.Future getAccountAddressByName(String? username) => (super.noSuchMethod( Invocation.method( #getAccountAddressByName, [username], @@ -362,16 +327,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future>.value(<_i10.Execution>[]), ) as _i8.Future>); @override - _i8.Future<_i2.Either<_i9.Failure, int>> getFaucetCoin( - {String? denom = r''}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, int>> getFaucetCoin({String? denom = r''}) => (super.noSuchMethod( Invocation.method( #getFaucetCoin, [], {#denom: denom}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value( - _FakeEither_0<_i9.Failure, int>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value(_FakeEither_0<_i9.Failure, int>( this, Invocation.method( #getFaucetCoin, @@ -389,15 +351,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future.value(false), ) as _i8.Future); @override - _i8.Future<_i3.SdkIpcResponse> updateRecipe( - Map? jsonMap) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> updateRecipe(Map? jsonMap) => (super.noSuchMethod( Invocation.method( #updateRecipe, [jsonMap], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #updateRecipe, @@ -406,18 +365,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future< - _i2.Either<_i9.Failure, _i6.AccountPublicInfo>> importPylonsAccount( - {required String? mnemonic}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>> importPylonsAccount({required String? mnemonic}) => (super.noSuchMethod( Invocation.method( #importPylonsAccount, [], {#mnemonic: mnemonic}, ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>.value( - _FakeEither_0<_i9.Failure, _i6.AccountPublicInfo>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>.value(_FakeEither_0<_i9.Failure, _i6.AccountPublicInfo>( this, Invocation.method( #importPylonsAccount, @@ -427,15 +381,12 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i6.AccountPublicInfo>>); @override - _i8.Future<_i3.SdkIpcResponse> updateCookbook( - Map? jsonMap) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> updateCookbook(Map? jsonMap) => (super.noSuchMethod( Invocation.method( #updateCookbook, [jsonMap], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #updateCookbook, @@ -449,8 +400,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { #getProfile, [], ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getProfile, @@ -467,8 +417,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future.value(''), ) as _i8.Future); @override - _i8.Future> getRecipesByCookbookID(String? cookbookID) => - (super.noSuchMethod( + _i8.Future> getRecipesByCookbookID(String? cookbookID) => (super.noSuchMethod( Invocation.method( #getRecipesByCookbookID, [cookbookID], @@ -476,16 +425,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future>.value(<_i10.Recipe>[]), ) as _i8.Future>); @override - _i8.Future<_i3.SdkIpcResponse> getAllRecipesByCookbookId( - {required String? cookbookId}) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> getAllRecipesByCookbookId({required String? cookbookId}) => (super.noSuchMethod( Invocation.method( #getAllRecipesByCookbookId, [], {#cookbookId: cookbookId}, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getAllRecipesByCookbookId, @@ -495,16 +441,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> getCookbookByIdForSDK( - {required String? cookbookId}) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> getCookbookByIdForSDK({required String? cookbookId}) => (super.noSuchMethod( Invocation.method( #getCookbookByIdForSDK, [], {#cookbookId: cookbookId}, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getCookbookByIdForSDK, @@ -550,8 +493,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { #recipeId: recipeId, }, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getExecutionByRecipeId, @@ -577,8 +519,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { #recipeId: recipeId, }, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getRecipeByIdForSDK, @@ -604,8 +545,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { #itemId: itemId, }, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getItemByIdForSDK, @@ -618,16 +558,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> getItemListByOwner( - {required String? owner}) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> getItemListByOwner({required String? owner}) => (super.noSuchMethod( Invocation.method( #getItemListByOwner, [], {#owner: owner}, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getItemListByOwner, @@ -637,16 +574,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> getExecutionBasedOnId( - {required String? id}) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> getExecutionBasedOnId({required String? id}) => (super.noSuchMethod( Invocation.method( #getExecutionBasedOnId, [], {#id: id}, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getExecutionBasedOnId, @@ -656,16 +590,13 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { )), ) as _i8.Future<_i3.SdkIpcResponse>); @override - _i8.Future<_i3.SdkIpcResponse> getTradesForSDK( - {required String? creator}) => - (super.noSuchMethod( + _i8.Future<_i3.SdkIpcResponse> getTradesForSDK({required String? creator}) => (super.noSuchMethod( Invocation.method( #getTradesForSDK, [], {#creator: creator}, ), - returnValue: _i8.Future<_i3.SdkIpcResponse>.value( - _FakeSdkIpcResponse_1( + returnValue: _i8.Future<_i3.SdkIpcResponse>.value(_FakeSdkIpcResponse_1( this, Invocation.method( #getTradesForSDK, @@ -683,9 +614,7 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { returnValue: _i8.Future.value(false), ) as _i8.Future); @override - _i2.Either<_i9.Failure, bool> saveInitialLink( - {required String? initialLink}) => - (super.noSuchMethod( + _i2.Either<_i9.Failure, bool> saveInitialLink({required String? initialLink}) => (super.noSuchMethod( Invocation.method( #saveInitialLink, [], @@ -715,41 +644,33 @@ class MockWalletsStore extends _i1.Mock implements _i7.WalletsStore { ), ) as _i2.Either<_i9.Failure, String>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> - sendGoogleInAppPurchaseCoinsRequest( - _i12.GoogleInAppPurchaseModel? googleInAppPurchaseModel) => - (super.noSuchMethod( - Invocation.method( - #sendGoogleInAppPurchaseCoinsRequest, - [googleInAppPurchaseModel], - ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( - this, - Invocation.method( - #sendGoogleInAppPurchaseCoinsRequest, - [googleInAppPurchaseModel], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, String>>); - @override - _i8.Future<_i2.Either<_i9.Failure, String>> - sendAppleInAppPurchaseCoinsRequest( - _i12.AppleInAppPurchaseModel? appleInAppPurchaseModel) => - (super.noSuchMethod( - Invocation.method( - #sendAppleInAppPurchaseCoinsRequest, - [appleInAppPurchaseModel], - ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( - this, - Invocation.method( - #sendAppleInAppPurchaseCoinsRequest, - [appleInAppPurchaseModel], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, String>>); + _i8.Future<_i2.Either<_i9.Failure, String>> sendGoogleInAppPurchaseCoinsRequest(_i12.GoogleInAppPurchaseModel? googleInAppPurchaseModel) => (super.noSuchMethod( + Invocation.method( + #sendGoogleInAppPurchaseCoinsRequest, + [googleInAppPurchaseModel], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( + this, + Invocation.method( + #sendGoogleInAppPurchaseCoinsRequest, + [googleInAppPurchaseModel], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, String>>); + @override + _i8.Future<_i2.Either<_i9.Failure, String>> sendAppleInAppPurchaseCoinsRequest(_i12.AppleInAppPurchaseModel? appleInAppPurchaseModel) => (super.noSuchMethod( + Invocation.method( + #sendAppleInAppPurchaseCoinsRequest, + [appleInAppPurchaseModel], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( + this, + Invocation.method( + #sendAppleInAppPurchaseCoinsRequest, + [appleInAppPurchaseModel], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, String>>); } /// A class which mocks [AccountPublicInfo]. @@ -844,8 +765,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #recipeId: recipeId, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Recipe>>.value( - _FakeEither_0<_i9.Failure, _i10.Recipe>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Recipe>>.value(_FakeEither_0<_i9.Failure, _i10.Recipe>( this, Invocation.method( #getRecipe, @@ -858,16 +778,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i10.Recipe>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> getUsername( - {required String? address}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> getUsername({required String? address}) => (super.noSuchMethod( Invocation.method( #getUsername, [], {#address: address}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #getUsername, @@ -877,36 +794,29 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>> - getRecipesBasedOnCookBookId({required String? cookBookId}) => - (super.noSuchMethod( - Invocation.method( - #getRecipesBasedOnCookBookId, - [], - {#cookBookId: cookBookId}, - ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>>.value( - _FakeEither_0<_i9.Failure, List<_i10.Recipe>>( - this, - Invocation.method( - #getRecipesBasedOnCookBookId, - [], - {#cookBookId: cookBookId}, - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i10.Cookbook>> getCookbookBasedOnId( - {required String? cookBookId}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>> getRecipesBasedOnCookBookId({required String? cookBookId}) => (super.noSuchMethod( + Invocation.method( + #getRecipesBasedOnCookBookId, + [], + {#cookBookId: cookBookId}, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>>.value(_FakeEither_0<_i9.Failure, List<_i10.Recipe>>( + this, + Invocation.method( + #getRecipesBasedOnCookBookId, + [], + {#cookBookId: cookBookId}, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Recipe>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i10.Cookbook>> getCookbookBasedOnId({required String? cookBookId}) => (super.noSuchMethod( Invocation.method( #getCookbookBasedOnId, [], {#cookBookId: cookBookId}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Cookbook>>.value( - _FakeEither_0<_i9.Failure, _i10.Cookbook>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Cookbook>>.value(_FakeEither_0<_i9.Failure, _i10.Cookbook>( this, Invocation.method( #getCookbookBasedOnId, @@ -916,15 +826,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i10.Cookbook>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> getAddressBasedOnUsername( - String? username) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> getAddressBasedOnUsername(String? username) => (super.noSuchMethod( Invocation.method( #getAddressBasedOnUsername, [username], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #getAddressBasedOnUsername, @@ -933,16 +840,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i14.Balance>>> getBalance( - String? address) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i14.Balance>>> getBalance(String? address) => (super.noSuchMethod( Invocation.method( #getBalance, [address], ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, List<_i14.Balance>>>.value( - _FakeEither_0<_i9.Failure, List<_i14.Balance>>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i14.Balance>>>.value(_FakeEither_0<_i9.Failure, List<_i14.Balance>>( this, Invocation.method( #getBalance, @@ -951,36 +854,31 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, List<_i14.Balance>>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i15.ExecutionListByRecipeResponse>> - getExecutionsByRecipeId({ + _i8.Future<_i2.Either<_i9.Failure, _i15.ExecutionListByRecipeResponse>> getExecutionsByRecipeId({ required String? cookBookId, required String? recipeId, }) => - (super.noSuchMethod( - Invocation.method( - #getExecutionsByRecipeId, - [], - { - #cookBookId: cookBookId, - #recipeId: recipeId, - }, - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i15.ExecutionListByRecipeResponse>>.value( - _FakeEither_0<_i9.Failure, _i15.ExecutionListByRecipeResponse>( - this, - Invocation.method( - #getExecutionsByRecipeId, - [], - { - #cookBookId: cookBookId, - #recipeId: recipeId, - }, - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i15.ExecutionListByRecipeResponse>>); + (super.noSuchMethod( + Invocation.method( + #getExecutionsByRecipeId, + [], + { + #cookBookId: cookBookId, + #recipeId: recipeId, + }, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i15.ExecutionListByRecipeResponse>>.value(_FakeEither_0<_i9.Failure, _i15.ExecutionListByRecipeResponse>( + this, + Invocation.method( + #getExecutionsByRecipeId, + [], + { + #cookBookId: cookBookId, + #recipeId: recipeId, + }, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i15.ExecutionListByRecipeResponse>>); @override _i8.Future<_i2.Either<_i9.Failure, int>> getFaucetCoin({ required String? address, @@ -995,8 +893,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #denom: denom, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value( - _FakeEither_0<_i9.Failure, int>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value(_FakeEither_0<_i9.Failure, int>( this, Invocation.method( #getFaucetCoin, @@ -1022,8 +919,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #itemId: itemId, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Item>>.value( - _FakeEither_0<_i9.Failure, _i10.Item>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Item>>.value(_FakeEither_0<_i9.Failure, _i10.Item>( this, Invocation.method( #getItem, @@ -1036,16 +932,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i10.Item>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Item>>> getListItemByOwner( - {required String? owner}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i10.Item>>> getListItemByOwner({required String? owner}) => (super.noSuchMethod( Invocation.method( #getListItemByOwner, [], {#owner: owner}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i10.Item>>>.value( - _FakeEither_0<_i9.Failure, List<_i10.Item>>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i10.Item>>>.value(_FakeEither_0<_i9.Failure, List<_i10.Item>>( this, Invocation.method( #getListItemByOwner, @@ -1055,16 +948,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Item>>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i10.Execution>> getExecutionBasedOnId( - {required String? id}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i10.Execution>> getExecutionBasedOnId({required String? id}) => (super.noSuchMethod( Invocation.method( #getExecutionBasedOnId, [], {#id: id}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Execution>>.value( - _FakeEither_0<_i9.Failure, _i10.Execution>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Execution>>.value(_FakeEither_0<_i9.Failure, _i10.Execution>( this, Invocation.method( #getExecutionBasedOnId, @@ -1074,17 +964,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i10.Execution>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Trade>>> getTradesBasedOnCreator( - {required String? creator}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i10.Trade>>> getTradesBasedOnCreator({required String? creator}) => (super.noSuchMethod( Invocation.method( #getTradesBasedOnCreator, [], {#creator: creator}, ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Trade>>>.value( - _FakeEither_0<_i9.Failure, List<_i10.Trade>>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i10.Trade>>>.value(_FakeEither_0<_i9.Failure, List<_i10.Trade>>( this, Invocation.method( #getTradesBasedOnCreator, @@ -1094,214 +980,150 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Trade>>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i6.PrivateAccountCredentials>> - getPrivateCredentials({ + _i8.Future<_i2.Either<_i9.Failure, _i6.PrivateAccountCredentials>> getPrivateCredentials({ required String? mnemonic, required String? username, }) => - (super.noSuchMethod( - Invocation.method( - #getPrivateCredentials, - [], - { - #mnemonic: mnemonic, - #username: username, - }, - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i6.PrivateAccountCredentials>>.value( - _FakeEither_0<_i9.Failure, _i6.PrivateAccountCredentials>( - this, - Invocation.method( - #getPrivateCredentials, - [], - { - #mnemonic: mnemonic, - #username: username, - }, - ), - )), - ) as _i8 - .Future<_i2.Either<_i9.Failure, _i6.PrivateAccountCredentials>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>> - CreatePaymentIntent(_i16.StripeCreatePaymentIntentRequest? req) => - (super.noSuchMethod( - Invocation.method( - #CreatePaymentIntent, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeCreatePaymentIntentResponse>>.value( - _FakeEither_0<_i9.Failure, - _i16.StripeCreatePaymentIntentResponse>( - this, - Invocation.method( - #CreatePaymentIntent, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePaymentReceiptResponse>> - GeneratePaymentReceipt(_i16.StripeGeneratePaymentReceiptRequest? req) => - (super.noSuchMethod( - Invocation.method( - #GeneratePaymentReceipt, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGeneratePaymentReceiptResponse>>.value( - _FakeEither_0<_i9.Failure, - _i16.StripeGeneratePaymentReceiptResponse>( - this, - Invocation.method( - #GeneratePaymentReceipt, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGeneratePaymentReceiptResponse>>); - @override - _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeGenerateRegistrationTokenResponse>> - GenerateRegistrationToken(String? address) => (super.noSuchMethod( - Invocation.method( - #GenerateRegistrationToken, - [address], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGenerateRegistrationTokenResponse>>.value( - _FakeEither_0<_i9.Failure, - _i16.StripeGenerateRegistrationTokenResponse>( - this, - Invocation.method( - #GenerateRegistrationToken, - [address], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGenerateRegistrationTokenResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeRegisterAccountResponse>> - RegisterAccount(_i16.StripeRegisterAccountRequest? req) => - (super.noSuchMethod( - Invocation.method( - #RegisterAccount, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeRegisterAccountResponse>>.value( - _FakeEither_0<_i9.Failure, _i16.StripeRegisterAccountResponse>( - this, - Invocation.method( - #RegisterAccount, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeRegisterAccountResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>> - GenerateUpdateToken(String? address) => (super.noSuchMethod( - Invocation.method( - #GenerateUpdateToken, - [address], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGenerateUpdateTokenResponse>>.value( - _FakeEither_0<_i9.Failure, - _i16.StripeGenerateUpdateTokenResponse>( - this, - Invocation.method( - #GenerateUpdateToken, - [address], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>> - UpdateAccount(_i16.StripeUpdateAccountRequest? req) => - (super.noSuchMethod( - Invocation.method( - #UpdateAccount, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeUpdateAccountResponse>>.value( - _FakeEither_0<_i9.Failure, _i16.StripeUpdateAccountResponse>( - this, - Invocation.method( - #UpdateAccount, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>> - getAccountLinkBasedOnUpdateToken(_i16.StripeUpdateAccountRequest? req) => - (super.noSuchMethod( - Invocation.method( - #getAccountLinkBasedOnUpdateToken, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeUpdateAccountResponse>>.value( - _FakeEither_0<_i9.Failure, _i16.StripeUpdateAccountResponse>( - this, - Invocation.method( - #getAccountLinkBasedOnUpdateToken, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>> - GeneratePayoutToken(_i16.StripeGeneratePayoutTokenRequest? req) => - (super.noSuchMethod( - Invocation.method( - #GeneratePayoutToken, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i16.StripeGeneratePayoutTokenResponse>>.value( - _FakeEither_0<_i9.Failure, - _i16.StripeGeneratePayoutTokenResponse>( - this, - Invocation.method( - #GeneratePayoutToken, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>>); - @override - _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeAccountLinkResponse>> GetAccountLink( - _i16.StripeAccountLinkRequest? req) => (super.noSuchMethod( + Invocation.method( + #getPrivateCredentials, + [], + { + #mnemonic: mnemonic, + #username: username, + }, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i6.PrivateAccountCredentials>>.value(_FakeEither_0<_i9.Failure, _i6.PrivateAccountCredentials>( + this, + Invocation.method( + #getPrivateCredentials, + [], + { + #mnemonic: mnemonic, + #username: username, + }, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i6.PrivateAccountCredentials>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>> CreatePaymentIntent(_i16.StripeCreatePaymentIntentRequest? req) => (super.noSuchMethod( + Invocation.method( + #CreatePaymentIntent, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>( + this, + Invocation.method( + #CreatePaymentIntent, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeCreatePaymentIntentResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePaymentReceiptResponse>> GeneratePaymentReceipt(_i16.StripeGeneratePaymentReceiptRequest? req) => (super.noSuchMethod( + Invocation.method( + #GeneratePaymentReceipt, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePaymentReceiptResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeGeneratePaymentReceiptResponse>( + this, + Invocation.method( + #GeneratePaymentReceipt, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePaymentReceiptResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateRegistrationTokenResponse>> GenerateRegistrationToken(String? address) => (super.noSuchMethod( + Invocation.method( + #GenerateRegistrationToken, + [address], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateRegistrationTokenResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeGenerateRegistrationTokenResponse>( + this, + Invocation.method( + #GenerateRegistrationToken, + [address], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateRegistrationTokenResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeRegisterAccountResponse>> RegisterAccount(_i16.StripeRegisterAccountRequest? req) => (super.noSuchMethod( + Invocation.method( + #RegisterAccount, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeRegisterAccountResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeRegisterAccountResponse>( + this, + Invocation.method( + #RegisterAccount, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeRegisterAccountResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>> GenerateUpdateToken(String? address) => (super.noSuchMethod( + Invocation.method( + #GenerateUpdateToken, + [address], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>( + this, + Invocation.method( + #GenerateUpdateToken, + [address], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGenerateUpdateTokenResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>> UpdateAccount(_i16.StripeUpdateAccountRequest? req) => (super.noSuchMethod( + Invocation.method( + #UpdateAccount, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeUpdateAccountResponse>( + this, + Invocation.method( + #UpdateAccount, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>> getAccountLinkBasedOnUpdateToken(_i16.StripeUpdateAccountRequest? req) => (super.noSuchMethod( + Invocation.method( + #getAccountLinkBasedOnUpdateToken, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeUpdateAccountResponse>( + this, + Invocation.method( + #getAccountLinkBasedOnUpdateToken, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeUpdateAccountResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>> GeneratePayoutToken(_i16.StripeGeneratePayoutTokenRequest? req) => (super.noSuchMethod( + Invocation.method( + #GeneratePayoutToken, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>( + this, + Invocation.method( + #GeneratePayoutToken, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeGeneratePayoutTokenResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i16.StripeAccountLinkResponse>> GetAccountLink(_i16.StripeAccountLinkRequest? req) => (super.noSuchMethod( Invocation.method( #GetAccountLink, [req], ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, _i16.StripeAccountLinkResponse>>.value( - _FakeEither_0<_i9.Failure, _i16.StripeAccountLinkResponse>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i16.StripeAccountLinkResponse>>.value(_FakeEither_0<_i9.Failure, _i16.StripeAccountLinkResponse>( this, Invocation.method( #GetAccountLink, @@ -1310,17 +1132,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i16.StripeAccountLinkResponse>>); @override - _i8.Future< - _i2.Either<_i9.Failure, _i17.StripeLoginLinkResponse>> stripeGetLoginLink( - _i18.StripeLoginLinkRequest? req) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i17.StripeLoginLinkResponse>> stripeGetLoginLink(_i18.StripeLoginLinkRequest? req) => (super.noSuchMethod( Invocation.method( #stripeGetLoginLink, [req], ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, _i17.StripeLoginLinkResponse>>.value( - _FakeEither_0<_i9.Failure, _i17.StripeLoginLinkResponse>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i17.StripeLoginLinkResponse>>.value(_FakeEither_0<_i9.Failure, _i17.StripeLoginLinkResponse>( this, Invocation.method( #stripeGetLoginLink, @@ -1329,40 +1146,27 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i17.StripeLoginLinkResponse>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i19.StripeGetLoginBasedOnAddressResponse>> - getLoginLinkBasedOnAddress( - _i19.StripeGetLoginBasedOnAddressRequest? req) => - (super.noSuchMethod( - Invocation.method( - #getLoginLinkBasedOnAddress, - [req], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - _i19.StripeGetLoginBasedOnAddressResponse>>.value( - _FakeEither_0<_i9.Failure, - _i19.StripeGetLoginBasedOnAddressResponse>( - this, - Invocation.method( - #getLoginLinkBasedOnAddress, - [req], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, - _i19.StripeGetLoginBasedOnAddressResponse>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i20.IBCTraceModel>> getIBCHashTrace( - {required String? ibcHash}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i19.StripeGetLoginBasedOnAddressResponse>> getLoginLinkBasedOnAddress(_i19.StripeGetLoginBasedOnAddressRequest? req) => (super.noSuchMethod( + Invocation.method( + #getLoginLinkBasedOnAddress, + [req], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i19.StripeGetLoginBasedOnAddressResponse>>.value(_FakeEither_0<_i9.Failure, _i19.StripeGetLoginBasedOnAddressResponse>( + this, + Invocation.method( + #getLoginLinkBasedOnAddress, + [req], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i19.StripeGetLoginBasedOnAddressResponse>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i20.IBCTraceModel>> getIBCHashTrace({required String? ibcHash}) => (super.noSuchMethod( Invocation.method( #getIBCHashTrace, [], {#ibcHash: ibcHash}, ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i20.IBCTraceModel>>.value( - _FakeEither_0<_i9.Failure, _i20.IBCTraceModel>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i20.IBCTraceModel>>.value(_FakeEither_0<_i9.Failure, _i20.IBCTraceModel>( this, Invocation.method( #getIBCHashTrace, @@ -1372,16 +1176,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i20.IBCTraceModel>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> doesStripeAccountExistsFromServer( - {required String? address}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> doesStripeAccountExistsFromServer({required String? address}) => (super.noSuchMethod( Invocation.method( #doesStripeAccountExistsFromServer, [], {#address: address}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #doesStripeAccountExistsFromServer, @@ -1391,8 +1192,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i2.Either<_i9.Failure, bool> getStripeAccountExistsFromLocal() => - (super.noSuchMethod( + _i2.Either<_i9.Failure, bool> getStripeAccountExistsFromLocal() => (super.noSuchMethod( Invocation.method( #getStripeAccountExistsFromLocal, [], @@ -1406,8 +1206,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future saveStripeAccountExistsLocal({required bool? isExist}) => - (super.noSuchMethod( + _i8.Future saveStripeAccountExistsLocal({required bool? isExist}) => (super.noSuchMethod( Invocation.method( #saveStripeAccountExistsLocal, [], @@ -1416,15 +1215,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { returnValue: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future<_i2.Either<_i9.Failure, String>> pickImageFromGallery( - _i21.PickImageModel? pickImageModel) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> pickImageFromGallery(_i21.PickImageModel? pickImageModel) => (super.noSuchMethod( Invocation.method( #pickImageFromGallery, [pickImageModel], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #pickImageFromGallery, @@ -1446,8 +1242,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #imagePath: imagePath, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveImage, @@ -1460,8 +1255,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i2.Either<_i9.Failure, String> getImagePath(String? uri) => - (super.noSuchMethod( + _i2.Either<_i9.Failure, String> getImagePath(String? uri) => (super.noSuchMethod( Invocation.method( #getImagePath, [uri], @@ -1475,16 +1269,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, String>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveIsBannerDark( - {required bool? isBannerDark}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveIsBannerDark({required bool? isBannerDark}) => (super.noSuchMethod( Invocation.method( #saveIsBannerDark, [], {#isBannerDark: isBannerDark}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveIsBannerDark, @@ -1508,16 +1299,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveEmail( - {required String? value}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveEmail({required String? value}) => (super.noSuchMethod( Invocation.method( #saveEmail, [], {#value: value}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveEmail, @@ -1541,8 +1329,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, String>); @override - _i2.Either<_i9.Failure, bool> saveInitialLink(String? initialLink) => - (super.noSuchMethod( + _i2.Either<_i9.Failure, bool> saveInitialLink(String? initialLink) => (super.noSuchMethod( Invocation.method( #saveInitialLink, [initialLink], @@ -1570,16 +1357,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, String>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveDescription( - {required String? description}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveDescription({required String? description}) => (super.noSuchMethod( Invocation.method( #saveDescription, [], {#description: description}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveDescription, @@ -1603,16 +1387,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, String>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveNotificationsPreference( - {required bool? notificationStatus}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveNotificationsPreference({required bool? notificationStatus}) => (super.noSuchMethod( Invocation.method( #saveNotificationsPreference, [], {#notificationStatus: notificationStatus}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveNotificationsPreference, @@ -1622,8 +1403,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i2.Either<_i9.Failure, bool> getNotificationsPreference() => - (super.noSuchMethod( + _i2.Either<_i9.Failure, bool> getNotificationsPreference() => (super.noSuchMethod( Invocation.method( #getNotificationsPreference, [], @@ -1637,16 +1417,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveNetworkEnvironmentPreference( - {required String? networkEnvironment}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveNetworkEnvironmentPreference({required String? networkEnvironment}) => (super.noSuchMethod( Invocation.method( #saveNetworkEnvironmentPreference, [], {#networkEnvironment: networkEnvironment}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveNetworkEnvironmentPreference, @@ -1656,8 +1433,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i2.Either<_i9.Failure, String> getNetworkEnvironmentPreference() => - (super.noSuchMethod( + _i2.Either<_i9.Failure, String> getNetworkEnvironmentPreference() => (super.noSuchMethod( Invocation.method( #getNetworkEnvironmentPreference, [], @@ -1671,15 +1447,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, String>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> saveImageInLocalDirectory( - String? imagePath) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> saveImageInLocalDirectory(String? imagePath) => (super.noSuchMethod( Invocation.method( #saveImageInLocalDirectory, [imagePath], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #saveImageInLocalDirectory, @@ -1688,14 +1461,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveMnemonic(String? mnemonics) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveMnemonic(String? mnemonics) => (super.noSuchMethod( Invocation.method( #saveMnemonic, [mnemonics], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveMnemonic, @@ -1704,14 +1475,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> getMnemonic() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> getMnemonic() => (super.noSuchMethod( Invocation.method( #getMnemonic, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #getMnemonic, @@ -1720,31 +1489,26 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>> - isBiometricAvailable() => (super.noSuchMethod( - Invocation.method( - #isBiometricAvailable, - [], - ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>>.value( - _FakeEither_0<_i9.Failure, _i22.BiometricType>( - this, - Invocation.method( - #isBiometricAvailable, - [], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>>); - @override - _i8.Future<_i2.Either<_i9.Failure, bool>> authenticate() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>> isBiometricAvailable() => (super.noSuchMethod( + Invocation.method( + #isBiometricAvailable, + [], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>>.value(_FakeEither_0<_i9.Failure, _i22.BiometricType>( + this, + Invocation.method( + #isBiometricAvailable, + [], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i22.BiometricType>>); + @override + _i8.Future<_i2.Either<_i9.Failure, bool>> authenticate() => (super.noSuchMethod( Invocation.method( #authenticate, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #authenticate, @@ -1753,14 +1517,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, void>> setApplicationDirectory() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, void>> setApplicationDirectory() => (super.noSuchMethod( Invocation.method( #setApplicationDirectory, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value( - _FakeEither_0<_i9.Failure, void>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value(_FakeEither_0<_i9.Failure, void>( this, Invocation.method( #setApplicationDirectory, @@ -1769,16 +1531,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, void>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveDefaultSecurityBiometric( - {required bool? biometricEnabled}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveDefaultSecurityBiometric({required bool? biometricEnabled}) => (super.noSuchMethod( Invocation.method( #saveDefaultSecurityBiometric, [], {#biometricEnabled: biometricEnabled}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveDefaultSecurityBiometric, @@ -1802,16 +1561,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveBiometricLogin( - {required bool? biometricEnabled}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveBiometricLogin({required bool? biometricEnabled}) => (super.noSuchMethod( Invocation.method( #saveBiometricLogin, [], {#biometricEnabled: biometricEnabled}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveBiometricLogin, @@ -1835,16 +1591,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveBiometricTransaction( - {required bool? biometricEnabled}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> saveBiometricTransaction({required bool? biometricEnabled}) => (super.noSuchMethod( Invocation.method( #saveBiometricTransaction, [], {#biometricEnabled: biometricEnabled}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveBiometricTransaction, @@ -1854,8 +1607,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i2.Either<_i9.Failure, bool> getBiometricTransaction() => - (super.noSuchMethod( + _i2.Either<_i9.Failure, bool> getBiometricTransaction() => (super.noSuchMethod( Invocation.method( #getBiometricTransaction, [], @@ -1869,68 +1621,55 @@ class MockRepository extends _i1.Mock implements _i13.Repository { ), ) as _i2.Either<_i9.Failure, bool>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i23.NftOwnershipHistory>>> - getNftOwnershipHistory({ + _i8.Future<_i2.Either<_i9.Failure, List<_i23.NftOwnershipHistory>>> getNftOwnershipHistory({ required String? itemId, required String? cookBookId, }) => - (super.noSuchMethod( - Invocation.method( - #getNftOwnershipHistory, - [], - { - #itemId: itemId, - #cookBookId: cookBookId, - }, - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - List<_i23.NftOwnershipHistory>>>.value( - _FakeEither_0<_i9.Failure, List<_i23.NftOwnershipHistory>>( - this, - Invocation.method( - #getNftOwnershipHistory, - [], - { - #itemId: itemId, - #cookBookId: cookBookId, - }, - ), - )), - ) as _i8 - .Future<_i2.Either<_i9.Failure, List<_i23.NftOwnershipHistory>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, List<_i24.TransactionHistory>>> - getTransactionHistory({required String? address}) => (super.noSuchMethod( - Invocation.method( - #getTransactionHistory, - [], - {#address: address}, - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - List<_i24.TransactionHistory>>>.value( - _FakeEither_0<_i9.Failure, List<_i24.TransactionHistory>>( - this, - Invocation.method( - #getTransactionHistory, - [], - {#address: address}, - ), - )), - ) as _i8 - .Future<_i2.Either<_i9.Failure, List<_i24.TransactionHistory>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, String>> updateRecipe( - {required _i10.MsgUpdateRecipe? msgUpdateRecipe}) => (super.noSuchMethod( + Invocation.method( + #getNftOwnershipHistory, + [], + { + #itemId: itemId, + #cookBookId: cookBookId, + }, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i23.NftOwnershipHistory>>>.value(_FakeEither_0<_i9.Failure, List<_i23.NftOwnershipHistory>>( + this, + Invocation.method( + #getNftOwnershipHistory, + [], + { + #itemId: itemId, + #cookBookId: cookBookId, + }, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i23.NftOwnershipHistory>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, List<_i24.TransactionHistory>>> getTransactionHistory({required String? address}) => (super.noSuchMethod( + Invocation.method( + #getTransactionHistory, + [], + {#address: address}, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i24.TransactionHistory>>>.value(_FakeEither_0<_i9.Failure, List<_i24.TransactionHistory>>( + this, + Invocation.method( + #getTransactionHistory, + [], + {#address: address}, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i24.TransactionHistory>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, String>> updateRecipe({required _i10.MsgUpdateRecipe? msgUpdateRecipe}) => (super.noSuchMethod( Invocation.method( #updateRecipe, [], {#msgUpdateRecipe: msgUpdateRecipe}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #updateRecipe, @@ -1953,8 +1692,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #username: username, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #uploadMnemonicGoogleDrive, @@ -1967,22 +1705,19 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>> - getGoogleDriveMnemonic() => (super.noSuchMethod( - Invocation.method( - #getGoogleDriveMnemonic, - [], - ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>.value( - _FakeEither_0<_i9.Failure, _i25.BackupData>( - this, - Invocation.method( - #getGoogleDriveMnemonic, - [], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>); + _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>> getGoogleDriveMnemonic() => (super.noSuchMethod( + Invocation.method( + #getGoogleDriveMnemonic, + [], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>.value(_FakeEither_0<_i9.Failure, _i25.BackupData>( + this, + Invocation.method( + #getGoogleDriveMnemonic, + [], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>); @override _i8.Future<_i2.Either<_i9.Failure, bool>> uploadMnemonicICloud({ required String? mnemonic, @@ -1997,8 +1732,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #username: username, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #uploadMnemonicICloud, @@ -2011,14 +1745,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>> getICloudMnemonic() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>> getICloudMnemonic() => (super.noSuchMethod( Invocation.method( #getICloudMnemonic, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>.value( - _FakeEither_0<_i9.Failure, _i25.BackupData>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>.value(_FakeEither_0<_i9.Failure, _i25.BackupData>( this, Invocation.method( #getICloudMnemonic, @@ -2027,34 +1759,28 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i25.BackupData>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>> - getCookbooksByCreator({required String? creator}) => (super.noSuchMethod( - Invocation.method( - #getCookbooksByCreator, - [], - {#creator: creator}, - ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>>.value( - _FakeEither_0<_i9.Failure, List<_i10.Cookbook>>( - this, - Invocation.method( - #getCookbooksByCreator, - [], - {#creator: creator}, - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i10.Trade>> getTradeByID( - _i11.Int64? id) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>> getCookbooksByCreator({required String? creator}) => (super.noSuchMethod( + Invocation.method( + #getCookbooksByCreator, + [], + {#creator: creator}, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>>.value(_FakeEither_0<_i9.Failure, List<_i10.Cookbook>>( + this, + Invocation.method( + #getCookbooksByCreator, + [], + {#creator: creator}, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i10.Cookbook>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i10.Trade>> getTradeByID(_i11.Int64? id) => (super.noSuchMethod( Invocation.method( #getTradeByID, [id], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Trade>>.value( - _FakeEither_0<_i9.Failure, _i10.Trade>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i10.Trade>>.value(_FakeEither_0<_i9.Failure, _i10.Trade>( this, Invocation.method( #getTradeByID, @@ -2071,8 +1797,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { returnValue: _i8.Future.value(false), ) as _i8.Future); @override - _i8.Stream<_i26.InternetConnectionStatus> getInternetStatus() => - (super.noSuchMethod( + _i8.Stream<_i26.InternetConnectionStatus> getInternetStatus() => (super.noSuchMethod( Invocation.method( #getInternetStatus, [], @@ -2093,8 +1818,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #cookBookID: cookBookID, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value( - _FakeEither_0<_i9.Failure, int>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value(_FakeEither_0<_i9.Failure, int>( this, Invocation.method( #getLikesCount, @@ -2120,8 +1844,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #cookBookID: cookBookID, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value( - _FakeEither_0<_i9.Failure, int>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value(_FakeEither_0<_i9.Failure, int>( this, Invocation.method( #getViewsCount, @@ -2149,8 +1872,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #walletAddress: walletAddress, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value( - _FakeEither_0<_i9.Failure, void>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value(_FakeEither_0<_i9.Failure, void>( this, Invocation.method( #countAView, @@ -2179,8 +1901,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #walletAddress: walletAddress, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #ifLikedByMe, @@ -2209,8 +1930,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #walletAddress: walletAddress, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value( - _FakeEither_0<_i9.Failure, void>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value(_FakeEither_0<_i9.Failure, void>( this, Invocation.method( #updateLikeStatus, @@ -2239,8 +1959,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #feedback: feedback, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveUserFeedback, @@ -2254,53 +1973,41 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> - sendAppleInAppPurchaseCoinsRequest( - _i12.AppleInAppPurchaseModel? appleInAppPurchaseModel) => - (super.noSuchMethod( - Invocation.method( - #sendAppleInAppPurchaseCoinsRequest, - [appleInAppPurchaseModel], - ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( - this, - Invocation.method( - #sendAppleInAppPurchaseCoinsRequest, - [appleInAppPurchaseModel], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, String>>); - @override - _i8.Future<_i2.Either<_i9.Failure, String>> - sendGoogleInAppPurchaseCoinsRequest( - _i12.GoogleInAppPurchaseModel? msgGoogleInAPPPurchase) => - (super.noSuchMethod( - Invocation.method( - #sendGoogleInAppPurchaseCoinsRequest, - [msgGoogleInAPPPurchase], - ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( - this, - Invocation.method( - #sendGoogleInAppPurchaseCoinsRequest, - [msgGoogleInAPPPurchase], - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, String>>); - @override - _i8.Future<_i2.Either<_i9.Failure, _i27.ProductDetails>> getProductsForSale( - {required String? itemId}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> sendAppleInAppPurchaseCoinsRequest(_i12.AppleInAppPurchaseModel? appleInAppPurchaseModel) => (super.noSuchMethod( + Invocation.method( + #sendAppleInAppPurchaseCoinsRequest, + [appleInAppPurchaseModel], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( + this, + Invocation.method( + #sendAppleInAppPurchaseCoinsRequest, + [appleInAppPurchaseModel], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, String>>); + @override + _i8.Future<_i2.Either<_i9.Failure, String>> sendGoogleInAppPurchaseCoinsRequest(_i12.GoogleInAppPurchaseModel? msgGoogleInAPPPurchase) => (super.noSuchMethod( + Invocation.method( + #sendGoogleInAppPurchaseCoinsRequest, + [msgGoogleInAPPPurchase], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( + this, + Invocation.method( + #sendGoogleInAppPurchaseCoinsRequest, + [msgGoogleInAPPPurchase], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, String>>); + @override + _i8.Future<_i2.Either<_i9.Failure, _i27.ProductDetails>> getProductsForSale({required String? itemId}) => (super.noSuchMethod( Invocation.method( #getProductsForSale, [], {#itemId: itemId}, ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i27.ProductDetails>>.value( - _FakeEither_0<_i9.Failure, _i27.ProductDetails>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i27.ProductDetails>>.value(_FakeEither_0<_i9.Failure, _i27.ProductDetails>( this, Invocation.method( #getProductsForSale, @@ -2310,15 +2017,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i27.ProductDetails>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> buyProduct( - _i27.ProductDetails? productDetails) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> buyProduct(_i27.ProductDetails? productDetails) => (super.noSuchMethod( Invocation.method( #buyProduct, [productDetails], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #buyProduct, @@ -2327,14 +2031,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> isInAppPurchaseAvailable() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> isInAppPurchaseAvailable() => (super.noSuchMethod( Invocation.method( #isInAppPurchaseAvailable, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #isInAppPurchaseAvailable, @@ -2356,8 +2058,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #fcmToken: fcmToken, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #updateFcmToken, @@ -2370,16 +2071,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> markNotificationAsRead( - {required List? idsList}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> markNotificationAsRead({required List? idsList}) => (super.noSuchMethod( Invocation.method( #markNotificationAsRead, [], {#idsList: idsList}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #markNotificationAsRead, @@ -2389,14 +2087,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> getAppCheckToken() => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> getAppCheckToken() => (super.noSuchMethod( Invocation.method( #getAppCheckToken, [], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #getAppCheckToken, @@ -2405,50 +2101,42 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i28.NotificationMessage>>> - getAllNotificationsMessages({ + _i8.Future<_i2.Either<_i9.Failure, List<_i28.NotificationMessage>>> getAllNotificationsMessages({ required String? walletAddress, required int? limit, required int? offset, }) => - (super.noSuchMethod( - Invocation.method( - #getAllNotificationsMessages, - [], - { - #walletAddress: walletAddress, - #limit: limit, - #offset: offset, - }, - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - List<_i28.NotificationMessage>>>.value( - _FakeEither_0<_i9.Failure, List<_i28.NotificationMessage>>( - this, - Invocation.method( - #getAllNotificationsMessages, - [], - { - #walletAddress: walletAddress, - #limit: limit, - #offset: offset, - }, - ), - )), - ) as _i8 - .Future<_i2.Either<_i9.Failure, List<_i28.NotificationMessage>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, bool>> saveInviteeAddressFromDynamicLink( - {required String? dynamicLink}) => (super.noSuchMethod( + Invocation.method( + #getAllNotificationsMessages, + [], + { + #walletAddress: walletAddress, + #limit: limit, + #offset: offset, + }, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i28.NotificationMessage>>>.value(_FakeEither_0<_i9.Failure, List<_i28.NotificationMessage>>( + this, + Invocation.method( + #getAllNotificationsMessages, + [], + { + #walletAddress: walletAddress, + #limit: limit, + #offset: offset, + }, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i28.NotificationMessage>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, bool>> saveInviteeAddressFromDynamicLink({required String? dynamicLink}) => (super.noSuchMethod( Invocation.method( #saveInviteeAddressFromDynamicLink, [], {#dynamicLink: dynamicLink}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #saveInviteeAddressFromDynamicLink, @@ -2458,16 +2146,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> createDynamicLinkForUserInvite( - {required String? address}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, String>> createDynamicLinkForUserInvite({required String? address}) => (super.noSuchMethod( Invocation.method( #createDynamicLinkForUserInvite, [], {#address: address}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( this, Invocation.method( #createDynamicLinkForUserInvite, @@ -2477,33 +2162,31 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override - _i8.Future<_i2.Either<_i9.Failure, String>> - createDynamicLinkForRecipeNftShare({ + _i8.Future<_i2.Either<_i9.Failure, String>> createDynamicLinkForRecipeNftShare({ required String? address, required _i29.NFT? nft, }) => - (super.noSuchMethod( - Invocation.method( - #createDynamicLinkForRecipeNftShare, - [], - { - #address: address, - #nft: nft, - }, - ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value( - _FakeEither_0<_i9.Failure, String>( - this, - Invocation.method( - #createDynamicLinkForRecipeNftShare, - [], - { - #address: address, - #nft: nft, - }, - ), - )), - ) as _i8.Future<_i2.Either<_i9.Failure, String>>); + (super.noSuchMethod( + Invocation.method( + #createDynamicLinkForRecipeNftShare, + [], + { + #address: address, + #nft: nft, + }, + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, String>>.value(_FakeEither_0<_i9.Failure, String>( + this, + Invocation.method( + #createDynamicLinkForRecipeNftShare, + [], + { + #address: address, + #nft: nft, + }, + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, String>>); @override _i8.Future<_i2.Either<_i9.Failure, _i30.TransactionResponse>> createAccount({ required _i6.AccountPublicInfo? publicInfo, @@ -2518,9 +2201,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #walletCreationModel: walletCreationModel, }, ), - returnValue: - _i8.Future<_i2.Either<_i9.Failure, _i30.TransactionResponse>>.value( - _FakeEither_0<_i9.Failure, _i30.TransactionResponse>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, _i30.TransactionResponse>>.value(_FakeEither_0<_i9.Failure, _i30.TransactionResponse>( this, Invocation.method( #createAccount, @@ -2533,15 +2214,12 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, _i30.TransactionResponse>>); @override - _i8.Future<_i2.Either<_i9.Failure, int>> saveLocalTransaction( - _i32.LocalTransactionModel? txManager) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, int>> saveLocalTransaction(_i32.LocalTransactionModel? txManager) => (super.noSuchMethod( Invocation.method( #saveLocalTransaction, [txManager], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value( - _FakeEither_0<_i9.Failure, int>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, int>>.value(_FakeEither_0<_i9.Failure, int>( this, Invocation.method( #saveLocalTransaction, @@ -2550,34 +2228,26 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, int>>); @override - _i8.Future<_i2.Either<_i9.Failure, List<_i32.LocalTransactionModel>>> - getAllTransactionFailures() => (super.noSuchMethod( - Invocation.method( - #getAllTransactionFailures, - [], - ), - returnValue: _i8.Future< - _i2.Either<_i9.Failure, - List<_i32.LocalTransactionModel>>>.value( - _FakeEither_0<_i9.Failure, List<_i32.LocalTransactionModel>>( - this, - Invocation.method( - #getAllTransactionFailures, - [], - ), - )), - ) as _i8.Future< - _i2.Either<_i9.Failure, List<_i32.LocalTransactionModel>>>); - @override - _i8.Future<_i2.Either<_i9.Failure, bool>> deleteTransactionFailureRecord( - int? id) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, List<_i32.LocalTransactionModel>>> getAllTransactionFailures() => (super.noSuchMethod( + Invocation.method( + #getAllTransactionFailures, + [], + ), + returnValue: _i8.Future<_i2.Either<_i9.Failure, List<_i32.LocalTransactionModel>>>.value(_FakeEither_0<_i9.Failure, List<_i32.LocalTransactionModel>>( + this, + Invocation.method( + #getAllTransactionFailures, + [], + ), + )), + ) as _i8.Future<_i2.Either<_i9.Failure, List<_i32.LocalTransactionModel>>>); + @override + _i8.Future<_i2.Either<_i9.Failure, bool>> deleteTransactionFailureRecord(int? id) => (super.noSuchMethod( Invocation.method( #deleteTransactionFailureRecord, [id], ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #deleteTransactionFailureRecord, @@ -2586,16 +2256,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, bool>> setUserIdentifierInAnalytics( - {required String? address}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, bool>> setUserIdentifierInAnalytics({required String? address}) => (super.noSuchMethod( Invocation.method( #setUserIdentifierInAnalytics, [], {#address: address}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #setUserIdentifierInAnalytics, @@ -2622,8 +2289,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #purchasePrice: purchasePrice, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #logPurchaseItem, @@ -2657,8 +2323,7 @@ class MockRepository extends _i1.Mock implements _i13.Repository { #currency: currency, }, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value( - _FakeEither_0<_i9.Failure, bool>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, bool>>.value(_FakeEither_0<_i9.Failure, bool>( this, Invocation.method( #logAddToCart, @@ -2674,16 +2339,13 @@ class MockRepository extends _i1.Mock implements _i13.Repository { )), ) as _i8.Future<_i2.Either<_i9.Failure, bool>>); @override - _i8.Future<_i2.Either<_i9.Failure, void>> logUserJourney( - {required String? screenName}) => - (super.noSuchMethod( + _i8.Future<_i2.Either<_i9.Failure, void>> logUserJourney({required String? screenName}) => (super.noSuchMethod( Invocation.method( #logUserJourney, [], {#screenName: screenName}, ), - returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value( - _FakeEither_0<_i9.Failure, void>( + returnValue: _i8.Future<_i2.Either<_i9.Failure, void>>.value(_FakeEither_0<_i9.Failure, void>( this, Invocation.method( #logUserJourney, @@ -3028,6 +2690,19 @@ class MockNFT extends _i1.Mock implements _i29.NFT { returnValueForMissingStub: null, ); @override + String get cid => (super.noSuchMethod( + Invocation.getter(#cid), + returnValue: '', + ) as String); + @override + set cid(String? _cid) => super.noSuchMethod( + Invocation.setter( + #cid, + _cid, + ), + returnValueForMissingStub: null, + ); + @override String get createdAt => (super.noSuchMethod( Invocation.getter(#createdAt), returnValue: '', diff --git a/wallet/test/widget_testing/components/buttons/nft_buy_button_test.dart b/wallet/test/widget_testing/components/buttons/nft_buy_button_test.dart index 63cd133a70..b6f7dd251c 100644 --- a/wallet/test/widget_testing/components/buttons/nft_buy_button_test.dart +++ b/wallet/test/widget_testing/components/buttons/nft_buy_button_test.dart @@ -1,28 +1,64 @@ +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:get_it/get_it.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; import 'package:pylons_wallet/generated/locale_keys.g.dart'; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; +import 'package:pylons_wallet/pages/purchase_item/purchase_item_screen.dart'; +import 'package:pylons_wallet/pages/purchase_item/purchase_item_view_model.dart'; +import 'package:pylons_wallet/pages/purchase_item/widgets/buy_nft_button.dart'; +import 'package:pylons_wallet/stores/wallet_store.dart'; +import 'package:pylons_wallet/utils/constants.dart'; import '../../../mocks/mock_constants.dart'; +import '../../../mocks/purchase_item_view_model.mocks.dart'; import '../../extension/size_extension.dart'; +import '../../../mocks/mock_wallet_store.dart'; import 'package:easy_localization/easy_localization.dart'; -import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; -import 'package:pylons_wallet/pages/purchase_item/widgets/buy_nft_button.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + final WalletsStore walletStore = MockWalletStore(); + final PurchaseItemViewModel viewModel = MockPurchaseItemViewModel(); + + testWidgets("check buy button is in expanded view or not", (tester) async { + GetIt.I.registerLazySingleton(() => walletStore); + GetIt.I.registerLazySingleton(() => viewModel); + + when(viewModel.collapsed).thenAnswer((realInvocation) => false); + when(viewModel.nft).thenAnswer((realInvocation) => MOCK_NFT_FREE_VIDEO); + when(viewModel.showBuyNowButton(isPlatformAndroid: Platform.isAndroid)).thenAnswer((realInvocation) => true); + await tester.testAppForWidgetTesting( + ChangeNotifierProvider.value( + value: viewModel, + child: PurchaseItemScreen( + nft: viewModel.nft, + ), + ), + ); + await tester.pump(); + final expandedBuyButtonFinder = find.byKey(const Key(kExpandedBuyButtonKeyValue)); + expect(expandedBuyButtonFinder, findsOneWidget); + }); testWidgets('should show the Free Drop NFT Buy Button and make sure user is able to tap', (tester) async { final buyButtonFinder = find.text(LocaleKeys.claim_free_nft.tr()); var isTapped = false; await tester.setScreenSize(); - await tester.testAppForWidgetTesting(Material( - child: BuyNFTButton( - onTapped: () { - isTapped = true; - }, - nft: MOCK_NFT_FREE_IMAGE, - ), - )); + await tester.testAppForWidgetTesting(ChangeNotifierProvider.value( + value: viewModel, + builder: (context, child) { + return Material( + child: BuyNFTButton( + onTapped: () { + isTapped = true; + }, + nft: MOCK_NFT_FREE_IMAGE, + ), + ); + })); expect(buyButtonFinder, findsOneWidget); await tester.tap(buyButtonFinder); @@ -31,15 +67,27 @@ void main() { }); testWidgets('should show the NFT Buy Button and make sure user is able to tap', (tester) async { - final buyButtonFinder = find.text("${LocaleKeys.buy_for.tr()} ${MOCK_NFT_PREMIUM.ibcCoins.getCoinWithProperDenomination(MOCK_NFT_PREMIUM.price)}"); + int counter = 0; + final buyButtonFinder = + find.text("${LocaleKeys.buy_for.tr()} ${MOCK_NFT_PREMIUM.ibcCoins.getCoinWithProperDenomination(MOCK_NFT_PREMIUM.price)} ${MOCK_NFT_PREMIUM.ibcCoins.getTrailingAbbrev()} "); await tester.setScreenSize(); - await tester.testAppForWidgetTesting(Material( - child: BuyNFTButton( - onTapped: () {}, - nft: MOCK_NFT_PREMIUM, + await tester.testAppForWidgetTesting(ChangeNotifierProvider.value( + value: viewModel, + child: Material( + child: BuyNFTButton( + key: const Key(MOCK_BUY_BUTTON_KEY_VALUE), + onTapped: () { + counter++; + }, + nft: MOCK_NFT_PREMIUM, + ), ), )); - + final buyButton = find.byKey(const Key(MOCK_BUY_BUTTON_KEY_VALUE)); + expect(counter, 0); + await tester.tap(buyButton); + await tester.pump(); expect(buyButtonFinder, findsOneWidget); + expect(counter, 1); }); }