diff --git a/easel/lib/models/denom.dart b/easel/lib/models/denom.dart index 17720e308f..653ac0059f 100644 --- a/easel/lib/models/denom.dart +++ b/easel/lib/models/denom.dart @@ -18,8 +18,8 @@ class Denom { } static List get availableDenoms => [ - Denom(name: kUSDText, symbol: kUsdSymbol, icon: PngUtils.kIconDenomUsd), - Denom(name: kPylonText, symbol: kPylonSymbol, icon: PngUtils.kIconDenomPylon), + Denom(name: kStripeText, symbol: kUsdSymbol, icon: PngUtils.kIconDenomUsd), + Denom(name: kIAPText, symbol: kPylonSymbol, icon: PngUtils.kIconDenomPylon), ]; TextInputFormatter getFormatter() { diff --git a/easel/lib/screens/publish_screen.dart b/easel/lib/screens/publish_screen.dart index 319ccea6d6..88f6072ff0 100644 --- a/easel/lib/screens/publish_screen.dart +++ b/easel/lib/screens/publish_screen.dart @@ -357,7 +357,7 @@ class _OwnerBottomDrawerState extends State { children: [ buildRow( title: LocaleKeys.currency.tr(), - subtitle: widget.nft.isFreeDrop == FreeDrop.yes.name ? kPylonText : getCurrency(), + subtitle: widget.nft.isFreeDrop == FreeDrop.yes.name ? kIAPText : getCurrency(), ), SizedBox(height: 5.h), buildRow(title: LocaleKeys.price.tr(), subtitle: getPriceSubtitle()), diff --git a/easel/lib/utils/constants.dart b/easel/lib/utils/constants.dart index 044dc6ce6a..d48f53618d 100644 --- a/easel/lib/utils/constants.dart +++ b/easel/lib/utils/constants.dart @@ -134,8 +134,8 @@ const kAgoricSymbol = 'urun'; const kJunoSymbol = 'ujunox'; const String kEthereumSymbol = "weth-wei"; -const kPylonText = 'Pylon'; -const kUSDText = 'USD'; +const kIAPText = 'IAP'; +const kStripeText = 'Stripe'; const kAtomText = 'Atom'; const kEurText = 'EEur'; const kAgoricText = 'Agoric'; diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index bb4ba5cb1e..9cc4eb74b8 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -40,6 +40,7 @@ import '../../utils/failure/failure.dart'; import 'widgets/create_trade_bottom_sheet.dart'; import 'widgets/toggle_button.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; class OwnerView extends StatefulWidget { final NFT nft; @@ -286,6 +287,11 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; + /// This change will reflect only for upylon ibcCoins + final coinWithDenom =ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" + : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; + return Padding( padding: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.w, top: 8.w), child: Column( @@ -328,7 +334,9 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) Text( - "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", + viewModel.nft.price == "0" + ? LocaleKeys.free.tr() + : coinWithDenom, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ], @@ -393,6 +401,11 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; + // This change will reflect only for upylon ibcCoins + final coinWithDenom = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" + : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; + return Stack( key: const ValueKey(kOwnerViewBottomSheetKeyValue), children: [ @@ -459,9 +472,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { width: 10.w, ), Text( - viewModel.viewsCount == 1 - ? "${viewModel.viewsCount} ${LocaleKeys.view.tr()}" - : "${viewModel.viewsCount} ${LocaleKeys.views.tr()}", + viewModel.viewsCount == 1 ? "${viewModel.viewsCount} ${LocaleKeys.view.tr()}" : "${viewModel.viewsCount} ${LocaleKeys.views.tr()}", style: TextStyle(color: Colors.white, fontSize: 12.sp), ) ], @@ -582,9 +593,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { recipeId: viewModel.nft.recipeID, ); }, - child: viewModel.isLiking - ? getLikingLoader() - : getLikeIcon(likedByMe: viewModel.likedByMe), + child: viewModel.isLiking ? getLikingLoader() : getLikeIcon(likedByMe: viewModel.likedByMe), ), ), SizedBox( @@ -619,8 +628,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { if (viewModel.nft.assetType == AssetType.Image && Platform.isAndroid) GestureDetector( onTap: () { - final WallpaperScreen wallpaperScreen = - WallpaperScreen(nft: viewModel.nft.url, context: context); + final WallpaperScreen wallpaperScreen = WallpaperScreen(nft: viewModel.nft.url, context: context); wallpaperScreen.show(); }, child: SvgPicture.asset( @@ -656,9 +664,11 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) ...[ Text( - "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", + viewModel.nft.price == "0" + ? LocaleKeys.free.tr() + : coinWithDenom, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), - ), + ) ] ], ), diff --git a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart index ad0f724cbd..ed5e3546a3 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart @@ -1,4 +1,3 @@ - import 'package:cached_network_image/cached_network_image.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -20,6 +19,7 @@ import '../../easel_section/no_easel_art_work.dart'; import '../collection_screen.dart'; import '../collection_view_model.dart'; import '../preview_nft_grid.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; class CreationsCollection extends StatelessWidget { final OnNFTSelected onNFTSelected; @@ -58,14 +58,20 @@ class CreationsCollection extends StatelessWidget { childrenDelegate: SliverChildBuilderDelegate( (context, index) { final nft = viewModel.creations[index]; + + /// This change will reflect only for upylon ibcCoins + /// message change request will reflect only if [isPylon] is [true] + final coinWithDenom = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" + : "${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}"; + + return ClipRRect( child: GestureDetector( onTap: () => onNFTSelected(nft), child: Banner( color: AppColors.kPriceTagColor, location: BannerLocation.topStart, - message: - "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}", + message: nft.price == "0" ? LocaleKeys.free.tr() : coinWithDenom, child: PreviewNFTGrid( assetType: nft.assetType, on3dNFT: (BuildContext context) => Container( @@ -153,4 +159,4 @@ Widget _getAudioThumbnailFromUrl({required String thumbnailUrl}) { ); } -} \ No newline at end of file +} 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 0044fe6762..67b17b2659 100644 --- a/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart +++ b/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart @@ -196,6 +196,12 @@ extension IBCCoinsDePar on IBCCoins { return "${(double.parse(amount) / kEthIntBase).toStringAsFixed(kCurrencyDecimalLength)} ${getAbbrev()}"; } } + + + String pylnToCredit(String amount) { + return( double.parse(amount)/10).toStringAsFixed(2); + } + } SizedBox getIconFromAsset(String ibcCoinIcon) => SizedBox( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart index 0fcf12d982..3738f312f3 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart @@ -16,6 +16,8 @@ import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/image_util.dart'; import '../../../../generated/locale_keys.g.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; + class CurrencyBackgroundCard extends StatelessWidget { final bool isDefault; @@ -109,6 +111,7 @@ class CurrencyCard extends StatelessWidget { @override Widget build(BuildContext context) { List denomSpecificTxList = []; + if (isDefault) { denomSpecificTxList = context.read().getDenomSpecificTxList( defaultCurrency: currencyModel.currency, @@ -198,11 +201,10 @@ class CurrencyCard extends StatelessWidget { getHelpIcon(context), const Spacer(), Text( - currencyModel.amount, + "\$${currencyModel.ibcCoins.pylnToCredit(currencyModel.amount)}", style: kCurrencyStyle, ), SizedBox(width: 10.w), - Text(currencyModel.ibcCoins.getAbbrev(), style: kCurrencyStyle), ], ), Align( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart index 1049d575ef..413ad91a48 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart @@ -8,6 +8,7 @@ import 'package:pylons_wallet/components/loading.dart'; import 'package:pylons_wallet/gen/assets.gen.dart'; import 'package:pylons_wallet/model/transaction.dart'; import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/client/pylons/recipe.pb.dart'; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/providers/account_provider.dart'; import 'package:pylons_wallet/pylons_app.dart'; import 'package:pylons_wallet/stores/wallet_store.dart'; @@ -68,11 +69,15 @@ class LatestTransactions extends StatelessWidget { Column getAmountColumn({required TransactionHistory txHistory}) { if (txHistory.transactionTypeEnum == WalletHistoryTransactionType.NFTSELL || txHistory.transactionTypeEnum == WalletHistoryTransactionType.RECEIVE) { + + final checkIfKPYLNAbbr = denomAbbr[defaultCurrency] == kPYLN_ABBREVATION; + final historyWithDenom = "${getPrefix(txHistory) ? "" : "+"}${checkIfKPYLNAbbr?"\$${IBCCoins.upylon.pylnToCredit(defaultCurrency.convertFromU(txHistory))}":defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}"; + return Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - "${getPrefix(txHistory) ? "" : "+"}${defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}", + historyWithDenom, style: _headingTextStyle, ), if (defaultCurrency != kUSD) diff --git a/wallet/lib/services/data_stores/remote_data_store.dart b/wallet/lib/services/data_stores/remote_data_store.dart index 5156acbf11..f11838fedb 100644 --- a/wallet/lib/services/data_stores/remote_data_store.dart +++ b/wallet/lib/services/data_stores/remote_data_store.dart @@ -28,6 +28,7 @@ import 'package:pylons_wallet/model/wallet_creation_model.dart'; import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/export.dart' as pylons; import 'package:pylons_wallet/modules/cosmos.tx.v1beta1/module/export.dart' as cosmos_tx; import 'package:pylons_wallet/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart'; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_trace_model.dart'; import 'package:pylons_wallet/services/third_party_services/analytics_helper.dart'; import 'package:pylons_wallet/services/third_party_services/firestore_helper.dart'; @@ -48,6 +49,7 @@ import '../../model/common.dart'; import '../../model/update_recipe_model.dart'; import '../../modules/Pylonstech.pylons.pylons/module/client/pylons/tx.pb.dart'; import '../../utils/types.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; abstract class RemoteDataStore { /// This method is used to generate the stripe registration token @@ -1199,6 +1201,10 @@ class RemoteDataStoreImp implements RemoteDataStore { @override Future createDynamicLinkForRecipeNftShare({required String address, required NFT nft}) async { + final updateText = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? + "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))}" + : "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}"; + final dynamicLinkParams = DynamicLinkParameters( link: Uri.parse("$bigDipperBaseLink?recipe_id=${nft.recipeID}&cookbook_id=${nft.cookbookID}&address=$address"), uriPrefix: kDeepLink, @@ -1213,6 +1219,12 @@ class RemoteDataStoreImp implements RemoteDataStore { Uri.parse("$bigDipperBaseLink?recipe_id=${nft.recipeID}&cookbook_id=${nft.cookbookID}&address=$address"), ), navigationInfoParameters: const NavigationInfoParameters(forcedRedirectEnabled: true), + socialMetaTagParameters: SocialMetaTagParameters( + title: nft.name, + imageUrl: Uri.parse(nft.url), + description: '${nft.description} Price:${nft.price == "0" ? LocaleKeys.free.tr() :updateText}' + , + ) ); final link = await dynamicLinksGenerator.buildShortLink( diff --git a/wallet/lib/utils/constants.dart b/wallet/lib/utils/constants.dart index 70750f5a2f..d143ff4159 100644 --- a/wallet/lib/utils/constants.dart +++ b/wallet/lib/utils/constants.dart @@ -187,7 +187,7 @@ const String kAgoric = "Agoric"; const String kJuno = "Juno"; const String kNone = "None"; const String kEmoney = "eMoney Euro"; -const String kPylons = "Pylons"; +const String kPylons = "Pylons Credit"; const String kDollar = "U.S. Dollar"; const String kPoints = "Points"; const String kAtom = "ATOM"; @@ -217,7 +217,7 @@ List colorListForPracticeTest = [ /// Currency ABRR const String kEmoneyAbb = "EEUR"; const String kAGoricAbb = "run"; -const String kPYLN_ABBREVATION = 'PYLN'; +const String kPYLN_ABBREVATION = 'credit'; const String kStripeUSD_ABR = 'USD'; const String kAgoricAbr = "RUN"; const String kAtomAbr = "ATOM";