diff --git a/assets b/assets index 5fbcdaca0..e7c3fdaf8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5fbcdaca096d5fa25c5e91e4d8c067a75f591276 +Subproject commit e7c3fdaf882e127b493faa39e8bd49245fa46c43 diff --git a/lib/common/environment.dart b/lib/common/environment.dart index 551822070..9dc197919 100644 --- a/lib/common/environment.dart +++ b/lib/common/environment.dart @@ -165,9 +165,6 @@ class Environment { static String get cloudFlareImageUrlPrefix => _readKey('CLOUD_FLARE_IMAGE_URL_PREFIX', ''); - static String get postcardContractAddress => - _readKey('POSTCARD_CONTRACT_ADDRESS', ''); - static String get merchandiseBaseUrl => _readKey('AUTONOMY_MERCHANDISE_BASE_URL', ''); @@ -176,8 +173,6 @@ class Environment { static String get payToMintBaseUrl => _readKey('PAY_TO_MINT_BASE_URL', ''); - static String get postcardChatServerUrl => _readKey('CHAT_SERVER_URL', ''); - static String get tzktMainnetURL => _readKey('TZKT_MAINNET_URL', ''); static String get tzktTestnetURL => _readKey('TZKT_TESTNET_URL', ''); diff --git a/lib/screen/home/collection_home_page.dart b/lib/screen/home/collection_home_page.dart index d3c394d90..4f5b6d0ca 100644 --- a/lib/screen/home/collection_home_page.dart +++ b/lib/screen/home/collection_home_page.dart @@ -115,8 +115,6 @@ class CollectionHomePageState extends State } Future _onTokensUpdate(List tokens) async { - //check minted postcard and navigator to artwork detail - // Check if there is any Tezos token in the list final List allAccountNumbers = _addressService.getAllWalletAddresses().map((e) => e.address).toList(); diff --git a/lib/service/configuration_service.dart b/lib/service/configuration_service.dart index 13c81cada..a89912580 100644 --- a/lib/service/configuration_service.dart +++ b/lib/service/configuration_service.dart @@ -162,7 +162,6 @@ class ConfigurationServiceImpl implements ConfigurationService { 'last_pull_announcement_time'; static const String KEY_HAS_MERCHANDISE_SUPPORT_INDEX_ID = 'has_merchandise_support'; - static const String KEY_POSTCARD_CHAT_CONFIG = 'postcard_chat_config'; static const String KEY_DID_MIGRATE_ADDRESS = 'did_migrate_address'; static const String KEY_HIDDEN_FEEDS = 'hidden_feeds'; static const String KEY_IAP_RECEIPT = 'key_iap_receipt'; @@ -180,7 +179,6 @@ class ConfigurationServiceImpl implements ConfigurationService { static const String KEY_READ_RELEASE_NOTES_VERSION = 'read_release_notes_version'; static const String ACCOUNT_HMAC_SECRET = 'account_hmac_secret'; - static const String KEY_SHARED_POSTCARD = 'shared_postcard'; static const String ANNOUNCEMENT_LAST_PULL_TIME = 'announcement_last_pull_time'; @@ -204,27 +202,12 @@ class ConfigurationServiceImpl implements ConfigurationService { static const String KEY_SUBSCRIPTION_TIME = 'subscription_time'; - static const String KEY_STAMPING_POSTCARD = 'stamping_postcard'; - - static const String KEY_AUTO_SHOW_POSTCARD = 'auto_show_postcard'; - - static const String KEY_ALREADY_SHOW_YOU_DID_IT_POSTCARD = - 'already_show_you_did_it_postcard'; - static const String KEY_CURRENT_GROUP_CHAT_ID = 'current_group_chat_id'; - static const String KEY_ALREADY_SHOW_POSTCARD_UPDATES = - 'already_show_postcard_updates'; - static const String KEY_MIXPANEL_PROPS = 'mixpanel_props'; static const String KEY_PACKAGE_INFO = 'package_info'; - static const String KEY_PROCESSING_STAMP_POSTCARD = - 'processing_stamp_postcard'; - - static const String KEY_SHOW_POSTCARD_BANNER = 'show_postcard_banner'; - static const String KEY_SHOW_ADD_ADDRESS_BANNER = 'show_add_address_banner'; static const String KEY_MERCHANDISE_ORDER_IDS = 'merchandise_order_ids'; @@ -235,8 +218,6 @@ class ConfigurationServiceImpl implements ConfigurationService { static const String KEY_SENT_TEZOS_ARTWORK_METRIC = 'sent_tezos_artwork_metric'; - static const String POSTCARD_MINT = 'postcard_mint'; - final SharedPreferences _preferences; ConfigurationServiceImpl(this._preferences); diff --git a/lib/service/remote_config_service.dart b/lib/service/remote_config_service.dart index 7e357d5d2..011dbadbc 100644 --- a/lib/service/remote_config_service.dart +++ b/lib/service/remote_config_service.dart @@ -39,7 +39,7 @@ class RemoteConfigServiceImpl implements RemoteConfigService { 'rights': true, 'chat': true }, - 'feature': {'download_stamp': true, 'download_postcard': true}, + 'feature': {'download_stamp': true}, 'postcard_action': {'wait_confirmed_to_send': false}, 'feralfile_artwork_action': { 'allow_download_artwork_contracts': [ @@ -254,7 +254,6 @@ enum ConfigKey { provenance, rights, downloadStamp, - downloadPostcard, chat, waitConfirmedToSend, allowDownloadArtworkContracts, @@ -308,8 +307,6 @@ extension ConfigKeyExtension on ConfigKey { return 'rights'; case ConfigKey.downloadStamp: return 'download_stamp'; - case ConfigKey.downloadPostcard: - return 'download_postcard'; case ConfigKey.chat: return 'chat'; case ConfigKey.waitConfirmedToSend: diff --git a/lib/util/asset_token_ext.dart b/lib/util/asset_token_ext.dart index d029cdb5f..fbf28100d 100644 --- a/lib/util/asset_token_ext.dart +++ b/lib/util/asset_token_ext.dart @@ -156,14 +156,6 @@ extension AssetTokenExtension on AssetToken { return null; } - void updatePostcardCID(String cid) { - if (Environment.appTestnetConfig) { - asset?.previewURL = '$POSTCARD_IPFS_PREFIX_TEST/$cid/'; - } else { - asset?.previewURL = '$POSTCARD_IPFS_PREFIX_PROD/$cid/'; - } - } - String? getBlockchainUrl() { final network = Environment.appTestnetConfig ? 'TESTNET' : 'MAINNET'; switch ('${network}_$blockchain') { diff --git a/lib/util/constants.dart b/lib/util/constants.dart index 6dff44654..3594f76ca 100644 --- a/lib/util/constants.dart +++ b/lib/util/constants.dart @@ -12,7 +12,6 @@ import 'package:autonomy_flutter/util/xtz_utils.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:feralfile_app_theme/feral_file_app_theme.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_chat_types/flutter_chat_types.dart'; import 'package:package_info_plus/package_info_plus.dart'; // ignore_for_file: constant_identifier_names @@ -53,9 +52,6 @@ const MOMA_MEMENTO_EXHIBITION_IDS = [ const cloudFlarePrefix = 'https://imagedelivery.net/'; -const POSTCARD_IPFS_PREFIX_TEST = 'https://ipfs.test.bitmark.com/ipfs'; -const POSTCARD_IPFS_PREFIX_PROD = 'https://ipfs.bitmark.com/ipfs'; - const TEIA_ART_CONTRACT_ADDRESSES = ['KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton']; const OPENSEA_ASSET_PREFIX = 'https://opensea.io/assets/'; const OBJKT_ASSET_PREFIX_MAINNET = 'https://objkt.com/asset/'; @@ -137,9 +133,6 @@ const double cellSpacing = 3; const TV_APP_STORE_URL = 'https://play.google.com/store/apps/details?id=com.bitmark.autonomy_tv'; -const MOMA_TERMS_CONDITIONS_URL = - 'https://github.com/bitmark-inc/autonomy-apps/blob/main/docs/postcard_terms.md'; - const AUTONOMY_DOCUMENT_PREFIX = 'https://github.com/bitmark-inc'; const AUTONOMY_RAW_DOCUMENT_PREFIX = @@ -425,7 +418,6 @@ class LinkType { static const beaconConnect = 'Beacon Connect'; static const feralFileToken = 'FeralFile Token'; static const walletConnect = 'Wallet Connect'; - static const postcardPayToMint = 'Postcard Pay To Mint'; static const undefined = 'Undefined'; } @@ -442,12 +434,3 @@ class KeyChain { class IrlWebviewFunction { static String closeWebview = '_closeWebview'; } - -const chatPrivateBannerId = 'chat_private_banner_id'; -final chatPrivateBannerMessage = SystemMessage( - id: chatPrivateBannerId, - author: const User(id: chatPrivateBannerId), - createdAt: 0, - text: 'chat_is_private'.tr(), - status: Status.delivered, -); diff --git a/lib/util/string_ext.dart b/lib/util/string_ext.dart index 1e7628b1a..436a2cec4 100644 --- a/lib/util/string_ext.dart +++ b/lib/util/string_ext.dart @@ -5,7 +5,6 @@ // that can be found in the LICENSE file. // -import 'package:autonomy_flutter/common/environment.dart'; import 'package:autonomy_flutter/nft_rendering/nft_rendering_widget.dart'; import 'package:autonomy_flutter/util/constants.dart'; @@ -80,12 +79,6 @@ extension StringExtension on String { } } - bool get isPostcardId { - final splitted = split('-'); - return splitted.length > 1 && - splitted[1] == Environment.postcardContractAddress; - } - bool get isAutonomyDocumentLink => (startsWith(AUTONOMY_DOCUMENT_PREFIX) || startsWith(AUTONOMY_RAW_DOCUMENT_PREFIX)) && diff --git a/lib/util/style.dart b/lib/util/style.dart index 7573fb3db..a53839724 100644 --- a/lib/util/style.dart +++ b/lib/util/style.dart @@ -7,7 +7,6 @@ import 'package:autonomy_flutter/util/log.dart'; import 'package:easy_localization/easy_localization.dart'; -import 'package:feralfile_app_theme/extensions/theme_extension/moma_sans.dart'; import 'package:feralfile_app_theme/feral_file_app_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -175,79 +174,6 @@ MarkdownStyleSheet markDownRightStyle(BuildContext context) { ); } -MarkdownStyleSheet markDownPostcardRightStyle(BuildContext context) { - final theme = Theme.of(context); - final baseStyle = theme.textTheme.moMASans400Black12; - final bodyText2 = theme.textTheme.ppMori400Black14; - return MarkdownStyleSheet( - a: baseStyle.copyWith( - color: Colors.transparent, - decoration: TextDecoration.underline, - shadows: [ - const Shadow( - offset: Offset(0, -1), - ), - ], - decorationStyle: TextDecorationStyle.solid, - decorationColor: Colors.black, - ), - p: baseStyle, - pPadding: const EdgeInsets.symmetric(horizontal: 15), - code: bodyText2.copyWith(backgroundColor: Colors.transparent), - h1: baseStyle.copyWith(fontSize: 16), - h1Padding: EdgeInsets.zero, - h2: baseStyle.copyWith(fontSize: 16), - h2Padding: EdgeInsets.zero, - h3: baseStyle.copyWith(fontSize: 16), - h3Padding: EdgeInsets.zero, - h4: baseStyle.copyWith(fontSize: 16), - h4Padding: EdgeInsets.zero, - h5: baseStyle.copyWith(fontSize: 16), - h5Padding: EdgeInsets.zero, - h6: baseStyle.copyWith(fontSize: 16), - h6Padding: EdgeInsets.zero, - em: const TextStyle(fontStyle: FontStyle.normal, color: Colors.black), - strong: baseStyle.copyWith(color: AppColor.auQuickSilver), - del: const TextStyle( - decoration: TextDecoration.lineThrough, - color: Colors.white, - ), - blockquote: bodyText2, - img: bodyText2, - checkbox: bodyText2.copyWith(color: theme.colorScheme.secondary), - blockSpacing: 16, - listIndent: 24, - listBullet: bodyText2.copyWith(color: Colors.black), - listBulletPadding: const EdgeInsets.only(right: 4), - tableHead: const TextStyle(fontWeight: FontWeight.w600), - tableBody: bodyText2, - tableHeadAlign: TextAlign.center, - tableBorder: TableBorder.all( - color: theme.dividerColor, - ), - tableColumnWidth: const FlexColumnWidth(), - tableCellsPadding: const EdgeInsets.fromLTRB(16, 8, 16, 8), - tableCellsDecoration: const BoxDecoration(), - blockquotePadding: const EdgeInsets.all(8), - blockquoteDecoration: BoxDecoration( - color: Colors.blue.shade100, - borderRadius: BorderRadius.circular(2), - ), - codeblockPadding: const EdgeInsets.all(8), - codeblockDecoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.circular(2), - ), - horizontalRuleDecoration: const BoxDecoration( - border: Border( - top: BorderSide( - color: Color.fromRGBO(236, 236, 236, 1), - ), - ), - ), - ); -} - MarkdownStyleSheet markDownAnnouncementStyle(BuildContext context) { final theme = Theme.of(context); final bodyText2 = theme.textTheme.ppMori400White12; diff --git a/lib/util/ui_helper.dart b/lib/util/ui_helper.dart index 8e1823a82..d44f5e52f 100644 --- a/lib/util/ui_helper.dart +++ b/lib/util/ui_helper.dart @@ -19,23 +19,17 @@ import 'package:autonomy_flutter/service/navigation_service.dart'; import 'package:autonomy_flutter/service/user_interactivity_service.dart'; import 'package:autonomy_flutter/util/au_icons.dart'; import 'package:autonomy_flutter/util/constants.dart'; -import 'package:autonomy_flutter/util/error_handler.dart'; import 'package:autonomy_flutter/util/inapp_notifications.dart'; import 'package:autonomy_flutter/util/log.dart'; -import 'package:autonomy_flutter/util/style.dart'; import 'package:autonomy_flutter/view/artwork_common_widget.dart'; import 'package:autonomy_flutter/view/au_button_clipper.dart'; import 'package:autonomy_flutter/view/back_appbar.dart'; -import 'package:autonomy_flutter/view/confetti.dart'; import 'package:autonomy_flutter/view/passkey/passkey_login_view.dart'; import 'package:autonomy_flutter/view/passkey/passkey_register_view.dart'; import 'package:autonomy_flutter/view/primary_button.dart'; import 'package:autonomy_flutter/view/responsive.dart'; -import 'package:autonomy_flutter/view/slide_router.dart'; import 'package:card_swiper/card_swiper.dart'; -import 'package:confetti/confetti.dart'; import 'package:easy_localization/easy_localization.dart'; -import 'package:feralfile_app_theme/extensions/theme_extension/moma_sans.dart'; import 'package:feralfile_app_theme/feral_file_app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -160,180 +154,6 @@ class UIHelper { ); } - static Future showPostCardDialog( - BuildContext context, - String title, - Widget content, { - bool isDismissible = false, - bool isRoundCorner = true, - int autoDismissAfter = 0, - FeedbackType? feedback = FeedbackType.selection, - EdgeInsets? padding, - }) async { - log.info('[UIHelper] showPostcardInfoDialog: $title'); - currentDialogTitle = title; - final theme = Theme.of(context); - - if (autoDismissAfter > 0) { - Future.delayed( - Duration(seconds: autoDismissAfter), - () => hideInfoDialog(context), - ); - } - - if (feedback != null) { - Vibrate.feedback(feedback); - } - - return await showModalBottomSheet( - context: context, - isDismissible: isDismissible, - backgroundColor: Colors.transparent, - enableDrag: false, - constraints: BoxConstraints( - maxWidth: ResponsiveLayout.isMobile - ? double.infinity - : Constants.maxWidthModalTablet, - ), - isScrollControlled: true, - barrierColor: Colors.black.withOpacity(0.5), - builder: (context) => Container( - color: Colors.transparent, - child: ClipPath( - clipper: isRoundCorner ? null : AutonomyTopRightRectangleClipper(), - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: isRoundCorner - ? const BorderRadius.only( - topRight: Radius.circular(20), - ) - : null, - ), - padding: padding ?? - const EdgeInsets.symmetric(horizontal: 14, vertical: 32), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Text( - title, - style: theme.primaryTextTheme.moMASans700Black18, - ), - ), - addDivider(height: 40, color: AppColor.chatPrimaryColor), - content, - ], - ), - ), - ), - ), - ), - ); - } - - static Future showPostcardDialogWithConfetti( - BuildContext context, - List contents, { - bool isDismissible = true, - int autoDismissAfter = 0, - FeedbackType? feedback = FeedbackType.selection, - }) async { - log.info('[UIHelper] showPostcardDialogWithConfetti'); - currentDialogTitle = 'showPostcardDialogWithConfetti'; - - const backgroundColor = AppColor.white; - const defaultSeparator = Divider( - height: 1, - thickness: 1, - color: Color.fromRGBO(227, 227, 227, 1), - ); - final confettiController = - ConfettiController(duration: const Duration(seconds: 15)); - Future.delayed(const Duration(milliseconds: 300), confettiController.play); - if (autoDismissAfter > 0) { - Future.delayed( - Duration(seconds: autoDismissAfter), - () => hideInfoDialog(context), - ); - } - - if (feedback != null) { - Vibrate.feedback(feedback); - } - - await Navigator.push( - context, - SlidableRoute( - color: AppColor.primaryBlack.withOpacity(0.4), - builder: (context) => Scaffold( - backgroundColor: Colors.transparent, - body: Stack( - children: [ - Column( - children: [ - Expanded( - child: GestureDetector( - onTap: () { - hideInfoDialog(context); - }, - child: Container( - color: Colors.transparent, - ), - ), - ), - Align( - alignment: Alignment.bottomCenter, - child: DecoratedBox( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), - ), - color: backgroundColor, - ), - child: Padding( - padding: const EdgeInsets.only( - left: 15, - right: 15, - bottom: 50, - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (BuildContext context, int index) { - final item = contents[index]; - - return Column( - children: [ - item, - defaultSeparator, - ], - ); - }, - itemCount: contents.length, - ), - ], - ), - ), - ), - ), - ], - ), - AllConfettiWidget(controller: confettiController), - ], - ), - ), - ), - ); - } - static Future showScrollableDialog( BuildContext context, Widget content, { @@ -1380,12 +1200,6 @@ class UIHelper { await showDialog(); } - static Future showAlreadyDelivered(BuildContext context) async { - final title = 'already_delivered'.tr(); - final description = 'it_seems_that'.tr(); - return showErrorDialog(context, title, description, 'close'.tr()); - } - static Future showInvalidURI(BuildContext context) async { await UIHelper.showDialog( context, diff --git a/lib/view/confetti.dart b/lib/view/confetti.dart deleted file mode 100644 index 955b5fabc..000000000 --- a/lib/view/confetti.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'dart:math'; - -import 'package:autonomy_flutter/util/style.dart'; -import 'package:confetti/confetti.dart'; -import 'package:flutter/material.dart'; - -class AllConfettiWidget extends StatefulWidget { - final ConfettiController controller; - - const AllConfettiWidget({ - required this.controller, - super.key, - }); - - @override - State createState() => _AllConfettiWidgetState(); -} - -class _AllConfettiWidgetState extends State { - final double blastDirection = -pi / 2; - - @override - Widget build(BuildContext context) => buildConfetti(); - - Widget buildConfetti() { - List moMAColors = [ - MomaPallet.pink, - MomaPallet.red, - MomaPallet.brick, - MomaPallet.lightBrick, - MomaPallet.orange, - MomaPallet.lightYellow, - MomaPallet.bananaYellow, - MomaPallet.green, - MomaPallet.riverGreen, - MomaPallet.cloudBlue, - MomaPallet.blue, - MomaPallet.purple, - ]; - return Align( - alignment: Alignment.topCenter, - child: ConfettiWidget( - confettiController: widget.controller, - colors: moMAColors, - blastDirectionality: BlastDirectionality.explosive, - emissionFrequency: 0, - numberOfParticles: 50, - ), - ); - } -}