Skip to content

Commit

Permalink
remove postcard related code
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangbtmrk committed Dec 4, 2024
1 parent 2399c07 commit 65fe787
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 374 deletions.
2 changes: 1 addition & 1 deletion assets
5 changes: 0 additions & 5 deletions lib/common/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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', '');

Expand All @@ -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', '');
Expand Down
2 changes: 0 additions & 2 deletions lib/screen/home/collection_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ class CollectionHomePageState extends State<CollectionHomePage>
}

Future<void> _onTokensUpdate(List<CompactedAssetToken> tokens) async {
//check minted postcard and navigator to artwork detail

// Check if there is any Tezos token in the list
final List<String> allAccountNumbers =
_addressService.getAllWalletAddresses().map((e) => e.address).toList();
Expand Down
19 changes: 0 additions & 19 deletions lib/service/configuration_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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';
Expand All @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions lib/service/remote_config_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down Expand Up @@ -254,7 +254,6 @@ enum ConfigKey {
provenance,
rights,
downloadStamp,
downloadPostcard,
chat,
waitConfirmedToSend,
allowDownloadArtworkContracts,
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions lib/util/asset_token_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
17 changes: 0 additions & 17 deletions lib/util/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/';
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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';
}

Expand All @@ -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,
);
7 changes: 0 additions & 7 deletions lib/util/string_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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)) &&
Expand Down
74 changes: 0 additions & 74 deletions lib/util/style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 65fe787

Please sign in to comment.