Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merchandise support #1332

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8274551
merchandise support
phuocbitmark Oct 24, 2023
bfe1aa7
use env
phuocbitmark Oct 24, 2023
39e89e2
close web view
phuocbitmark Oct 25, 2023
e573e57
set localStorage
phuocbitmark Oct 25, 2023
4e0f822
change type name
phuocbitmark Oct 26, 2023
120ce83
support ios, pass jwt token via param
phuocbitmark Oct 26, 2023
e280de2
fix ui text
phuocbitmark Oct 30, 2023
8974bec
allow view-only
phuocbitmark Oct 31, 2023
0290fb3
pay to mint
phuocbitmark Oct 27, 2023
c3278fc
must select
phuocbitmark Oct 30, 2023
43f32b3
select address then open irl
phuocbitmark Oct 31, 2023
e88b6d5
first claim is moma
phuocbitmark Oct 31, 2023
c396c60
refactor constant color
phuocbitmark Oct 31, 2023
1995573
change domain
phuocbitmark Oct 31, 2023
577b566
fix navigate
phuocbitmark Nov 1, 2023
7fb3d10
change path
phuocbitmark Nov 1, 2023
16b0df1
assets
phuocbitmark Nov 3, 2023
c0ecb6a
add artwork metadata in dummy asset
phuocbitmark Nov 3, 2023
a999f0a
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 3, 2023
090ace8
fix conflict
phuocbitmark Nov 3, 2023
7975689
dummy asset
phuocbitmark Nov 3, 2023
39dc91c
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 3, 2023
a6f3232
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 6, 2023
39651ee
fix conflict
phuocbitmark Nov 6, 2023
32f85f7
fix lint
phuocbitmark Nov 6, 2023
52f8b21
Update lib/screen/irl_screen/webview_irl_screen.dart
phuocbitmark Nov 6, 2023
d94b115
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 6, 2023
670e525
support branch link
phuocbitmark Nov 6, 2023
6145253
pay to mint: token id, address
phuocbitmark Nov 6, 2023
824ee21
logging
phuocbitmark Nov 6, 2023
a533aa8
set token pending
phuocbitmark Nov 6, 2023
73d364b
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 6, 2023
6c1ba23
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 8, 2023
6aab795
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 10, 2023
9b23443
Merge branch 'develop' into merchandise_support
phuocbitmark Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/android-release-appcenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_TESTNET }} >> .env || echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_MAINNET }} >> .env

echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bmvn_build_appcenter_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ inputs.testnet == true }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_TESTNET }} >> .env || echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_MAINNET }} >> .env

echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bmvn_build_appcenter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ inputs.testnet == true }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_TESTNET }} >> .env || echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_MAINNET }} >> .env

echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ios-release-appstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_TESTNET }} >> .env || echo PAY_TO_MINT_BASE_URL=${{ secrets.PAY_TO_MINT_BASE_URL_MAINNET }} >> .env

echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
6 changes: 6 additions & 0 deletions lib/common/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ class Environment {
static String get postcardContractAddress =>
dotenv.env['POSTCARD_CONTRACT_ADDRESS'] ?? '';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

static String get merchandiseBaseUrl =>
dotenv.env["AUTONOMY_MERCHANDISE_BASE_URL"] ?? "";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

static String get payToMintBaseUrl =>
dotenv.env["PAY_TO_MINT_BASE_URL"] ?? "";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

static String get chatServerHmacKey =>
dotenv.env['CHAT_SERVER_HMAC_KEY'] ?? '';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
41 changes: 37 additions & 4 deletions lib/model/postcard_claim.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,10 @@
final String id;
final String? otp;

RequestPostcardRequest({
required this.id,
this.otp
});
RequestPostcardRequest({required this.id, this.otp});

// fromJson method
factory RequestPostcardRequest.fromJson(Map<String, dynamic> json) {

Check warning on line 177 in lib/model/postcard_claim.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/model/postcard_claim.dart:177:- factory RequestPostcardRequest.fromJson(Map<String, dynamic> json) { lib/model/postcard_claim.dart:178:- return RequestPostcardRequest( lib/model/postcard_claim.dart:179:- id: json['id'] as String, lib/model/postcard_claim.dart:180:- otp: json['otp'] as String?, lib/model/postcard_claim.dart:156:+ factory RequestPostcardRequest.fromJson(final Map<String, dynamic> json) => RequestPostcardRequest( lib/model/postcard_claim.dart:157:+ id: json["id"] as String, lib/model/postcard_claim.dart:158:+ otp: json["otp"] as String?,
return RequestPostcardRequest(
id: json['id'] as String,
otp: json['otp'] as String?,
Expand Down Expand Up @@ -223,3 +220,39 @@
};
}
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
}

class PayToMintRequest extends RequestPostcardResponse {
final String address;
final String tokenId;

//constructor
PayToMintRequest({
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
required this.address,
required this.tokenId,
required super.claimID,
required super.name,
required super.previewURL,
});

@override
Map<String, dynamic> toJson() {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return <String, dynamic>{
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
'claimID': claimID,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
'name': name,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
'previewURL': previewURL,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
'address': address,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
'tokenId': tokenId,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
};
}
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

// fromJson method
factory PayToMintRequest.fromJson(Map<String, dynamic> json) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return PayToMintRequest(
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
claimID: json['claimID'] as String,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
name: json['name'] as String,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
previewURL: json['previewURL'] as String,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
address: json['address'] as String,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
tokenId: json['tokenId'] as String,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
);
}
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
}
11 changes: 11 additions & 0 deletions lib/screen/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// that can be found in the LICENSE file.
//

import 'package:autonomy_flutter/common/injector.dart';

Check warning on line 8 in lib/screen/app_router.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/app_router.dart:8:-import 'package:autonomy_flutter/common/injector.dart'; lib/screen/app_router.dart:9:-import 'package:autonomy_flutter/database/app_database.dart'; lib/screen/app_router.dart:10:-import 'package:autonomy_flutter/database/cloud_database.dart'; lib/screen/app_router.dart:11:-import 'package:autonomy_flutter/database/entity/connection.dart'; lib/screen/app_router.dart:12:-import 'package:autonomy_flutter/model/connection_request_args.dart'; lib/screen/app_router.dart:13:-import 'package:autonomy_flutter/model/ff_account.dart'; lib/screen/app_router.dart:14:-import 'package:autonomy_flutter/model/play_list_model.dart'; lib/screen/app_router.dart:15:-import 'package:autonomy_flutter/model/postcard_claim.dart'; lib/screen/app_router.dart:16:-import 'package:autonomy_flutter/model/wc2_request.dart'; lib/screen/app_router.dart:17:-import 'package:autonomy_flutter/screen/account/access_method_page.dart'; lib/screen/app_router.dart:18:-import 'package:autonomy_flutter/screen/account/link_manually_page.dart'; lib/screen/app_router.dart:19:-import 'package:autonomy_flutter/screen/account/recovery_phrase_page.dart'; lib/screen/app_router.dart:20:-import 'package:autonomy_flutter/screen/account/select_account_page.dart'; lib/screen/app_router.dart:21:-import 'package:autonomy_flutter/screen/account/test_artwork_screen.dart'; lib/screen/app_router.dart:22:-import 'package:autonomy_flutter/screen/autonomy_security_page.dart'; lib/screen/app_router.dart:23:-import 'package:autonomy_flutter/screen/bloc/accounts/accounts_bloc.dart'; lib/screen/app_router.dart:24:-import 'package:autonomy_flutter/screen/bloc/connections/connections_bloc.dart'; lib/screen/app_router.dart:25:-import 'package:autonomy_flutter/screen/bloc/ethereum/ethereum_bloc.dart'; lib/screen/app_router.dart:26:-import 'package:autonomy_flutter/screen/bloc/identity/identity_bloc.dart'; lib/screen/app_router.dart:27:-import 'package:autonomy_flutter/screen/bloc/persona/persona_bloc.dart'; lib/screen/app_router.dart:28:-import 'package:autonomy_flutter/screen/bloc/router/router_bloc.dart'; lib/screen/app_router.dart:29:-import 'package:autonomy_flutter/screen/bloc/scan_wallet/scan_wallet_bloc.dart'; lib/screen/app_router.dart:30:-import 'package:autonomy_flutter/screen/bloc/tezos/tezos_bloc.dart'; lib/screen/app_router.dart:31:-import 'package:autonomy_flutter/screen/bloc/usdc/usdc_bloc.dart'; lib/screen/app_router.dart:32:-import 'package:autonomy_flutter/screen/bug_bounty_page.dart'; lib/screen/app_router.dart:33:-import 'package:autonomy_flutter/screen/chat/chat_thread_page.dart'; lib/screen/app_router.dart:34:-import 'package:autonomy_flutter/screen/claim/activation/activation_token_detail_page.dart'; lib/screen/app_router.dart:35:-import 'package:autonomy_flutter/screen/claim/activation/claim_activation_page.dart'; lib/screen/app_router.dart:36:-import 'package:autonomy_flutter/screen/claim/activation/preview_activation_claim.dart'; lib/screen/app_router.dart:37:-import 'package:autonomy_flutter/screen/claim/airdrop/claim_airdrop_page.dart'; lib/screen/app_router.dart:38:-import 'package:autonomy_flutter/screen/claim/claim_token_page.dart'; lib/screen/app_router.dart:39:-import 'package:autonomy_flutter/screen/claim/select_account_page.dart'; lib/screen/app_router.dart:40:-import 'package:autonomy_flutter/screen/claim/token_detail_page.dart'; lib/screen/app_router.dart:41:-import 'package:autonomy_flutter/screen/cloud/cloud_android_page.dart'; lib/screen/app_router.dart:42:-import 'package:autonomy_flutter/screen/cloud/cloud_page.dart'; lib/screen/app_router.dart:43:-import 'package:autonomy_flutter/screen/connection/connection_details_page.dart'; lib/screen/app_router.dart:44:-import 'package:autonomy_flutter/screen/connection/persona_connections_page.dart'; lib/screen/app_router.dart:45:-import 'package:autonomy_flutter/screen/customer_support/support_customer_page.dart'; lib/screen/app_router.dart:46:-import 'package:autonomy_flutter/screen/customer_support/support_list_page.dart'; lib/scre
import 'package:autonomy_flutter/database/app_database.dart';
import 'package:autonomy_flutter/database/cloud_database.dart';
import 'package:autonomy_flutter/database/entity/connection.dart';
Expand Down Expand Up @@ -67,6 +67,7 @@
import 'package:autonomy_flutter/screen/home/home_bloc.dart';
import 'package:autonomy_flutter/screen/home/home_navigation_page.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/pay_to_mint_postcard_screen.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/hand_signature_page.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/leaderboard/postcard_leaderboard.dart';
Expand Down Expand Up @@ -198,6 +199,7 @@
static const handSignaturePage = "hand_signature_page";
static const stampPreview = "stamp_preview";
static const claimEmptyPostCard = "claim_empty_postcard";
static const payToMintPostcard = "pay_to_mint_postcard";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
static const selectAddressScreen = "select_address_screen";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
static const receivePostcardPage = 'receive_postcard_page';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
static const receivePostcardSelectAccountPage =
Expand Down Expand Up @@ -1039,13 +1041,22 @@
final claimRequest = settings.arguments as RequestPostcardResponse;
return CupertinoPageRoute(
settings: settings,
builder: (context) {

Check warning on line 1044 in lib/screen/app_router.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/app_router.dart:1044:- builder: (context) { lib/screen/app_router.dart:1045:- return ClaimEmptyPostCardScreen(claimRequest: claimRequest); lib/screen/app_router.dart:1046:- }, lib/screen/app_router.dart:1026:+ builder: (final context) => ClaimEmptyPostCardScreen(claimRequest: claimRequest),
return ClaimEmptyPostCardScreen(claimRequest: claimRequest);
},
);

case payToMintPostcard:
final claimRequest = settings.arguments as PayToMintRequest;
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return CupertinoPageRoute(
settings: settings,
builder: (context) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return PayToMintPostcardScreen(claimRequest: claimRequest);
},
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
);

case selectAddressScreen:
final arguments = settings.arguments as Map;

Check warning on line 1059 in lib/screen/app_router.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/app_router.dart:1059:- final arguments = settings.arguments as Map; lib/screen/app_router.dart:1060:- final blockchain = arguments['blockchain'] as String; lib/screen/app_router.dart:1061:- final onConfirm = arguments['onConfirm'] as Future Function(String); lib/screen/app_router.dart:1062:- final withLinked = (arguments['withLinked'] ?? true) as bool; lib/screen/app_router.dart:1037:+ final arguments = settings.arguments! as Map; lib/screen/app_router.dart:1038:+ final blockchain = arguments["blockchain"] as String; lib/screen/app_router.dart:1039:+ final onConfirm = arguments["onConfirm"] as Future Function(String); lib/screen/app_router.dart:1040:+ final withLinked = (arguments["withLinked"] ?? true) as bool;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
final arguments = settings.arguments as Map;
final arguments = settings.arguments! as Map;

final blockchain = arguments['blockchain'] as String;
final onConfirm = arguments['onConfirm'] as Future Function(String);
final withLinked = (arguments['withLinked'] ?? true) as bool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import 'dart:convert';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

import 'package:autonomy_flutter/common/environment.dart';

Check warning on line 3 in lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:3:-import 'package:autonomy_flutter/common/environment.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:4:-import 'package:autonomy_flutter/common/injector.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:5:-import 'package:autonomy_flutter/model/postcard_metadata.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:6:-import 'package:autonomy_flutter/screen/app_router.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:7:-import 'package:autonomy_flutter/service/account_service.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:8:-import 'package:autonomy_flutter/service/configuration_service.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:9:-import 'package:autonomy_flutter/service/metric_client_service.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:10:-import 'package:autonomy_flutter/service/navigation_service.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:11:-import 'package:autonomy_flutter/service/postcard_service.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:12:-import 'package:autonomy_flutter/util/wallet_utils.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:13:-import 'package:dio/dio.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:14:-import 'package:flutter_bloc/flutter_bloc.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:15:-import 'package:nft_collection/models/models.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:3:+import "package:autonomy_flutter/common/environment.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:4:+import "package:autonomy_flutter/common/injector.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:5:+import "package:autonomy_flutter/model/postcard_metadata.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:6:+import "package:autonomy_flutter/screen/app_router.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:7:+import "package:autonomy_flutter/service/account_service.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:8:+import "package:autonomy_flutter/service/configuration_service.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:9:+import "package:autonomy_flutter/service/metric_client_service.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:10:+import "package:autonomy_flutter/service/navigation_service.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:11:+import "package:autonomy_flutter/service/postcard_service.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:12:+import "package:autonomy_flutter/util/wallet_utils.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:13:+import "package:dio/dio.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:14:+import "package:flutter_bloc/flutter_bloc.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart:15:+import "package:nft_collection/models/models.dart";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/common/injector.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/model/postcard_metadata.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/screen/app_router.dart';
import 'package:autonomy_flutter/service/account_service.dart';
import 'package:autonomy_flutter/service/configuration_service.dart';
Expand All @@ -21,6 +25,9 @@

ClaimEmptyPostCardBloc() : super(ClaimEmptyPostCardState()) {
on<GetTokenEvent>((event, emit) async {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
final postcardMetadata = PostcardMetadata(
locationInformation: [],
);
final token = AssetToken(
asset: Asset.init(
artistName: 'MoMa',
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -29,12 +36,15 @@
title: event.claimRequest.name,
medium: 'software',
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
previewURL: event.claimRequest.previewURL,
artworkMetadata: event.createMetadata
? jsonEncode(postcardMetadata.toJson())
: null,
),
blockchain: "tezos",
fungible: true,
contractType: 'fa2',
tokenId: '1',
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
contractAddress: '',
contractAddress: Environment.postcardContractAddress,
edition: 0,
editionName: "",
id: "tez-",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:autonomy_flutter/common/injector.dart';

Check warning on line 1 in lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:1:-import 'package:autonomy_flutter/common/injector.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:2:-import 'package:autonomy_flutter/model/postcard_claim.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:3:-import 'package:autonomy_flutter/screen/app_router.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:4:-import 'package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:5:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:6:-import 'package:autonomy_flutter/util/constants.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:7:-import 'package:autonomy_flutter/view/postcard_button.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:8:-import 'package:easy_localization/easy_localization.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:9:-import 'package:flutter/material.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:10:-import 'package:flutter_bloc/flutter_bloc.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:11:- lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:12:-import 'claim_empty_postcard_bloc.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:13:-import 'claim_empty_postcard_state.dart'; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:1:+import "package:autonomy_flutter/common/injector.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:2:+import "package:autonomy_flutter/model/postcard_claim.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:3:+import "package:autonomy_flutter/screen/app_router.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:4:+import "package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:5:+import "package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_state.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:6:+import "package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:7:+import "package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:8:+import "package:autonomy_flutter/util/constants.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:9:+import "package:autonomy_flutter/view/postcard_button.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:10:+import "package:easy_localization/easy_localization.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:11:+import "package:flutter/material.dart"; lib/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_screen.dart:12:+import "package:flutter_bloc/flutter_bloc.dart";
import 'package:autonomy_flutter/model/postcard_claim.dart';
import 'package:autonomy_flutter/screen/app_router.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart';
import 'package:autonomy_flutter/util/constants.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/view/postcard_button.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -61,7 +62,7 @@
onTap: () {
bloc.add(AcceptGiftEvent(widget.claimRequest));
},
color: const Color.fromRGBO(79, 174, 79, 1),
color: POSTCARD_GREEN_BUTTON_COLOR,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ class ClaimEmptyPostCardState {

class GetTokenEvent extends ClaimEmptyPostCardEvent {
final RequestPostcardResponse claimRequest;
final bool createMetadata;

// constructor
GetTokenEvent(this.claimRequest);
GetTokenEvent(this.claimRequest, {this.createMetadata = false});
}

class AcceptGiftEvent extends ClaimEmptyPostCardEvent {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import 'package:autonomy_flutter/common/injector.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/model/postcard_claim.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/screen/app_router.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/util/asset_token_ext.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/util/constants.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/view/postcard_button.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:easy_localization/easy_localization.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:flutter/material.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:flutter_bloc/flutter_bloc.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

import 'claim_empty_postcard_bloc.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'claim_empty_postcard_state.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +13 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
import 'claim_empty_postcard_bloc.dart';
import 'claim_empty_postcard_state.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_state.dart';


class PayToMintPostcardScreen extends StatefulWidget {
final PayToMintRequest claimRequest;
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

const PayToMintPostcardScreen({super.key, required this.claimRequest});
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

@override
State<PayToMintPostcardScreen> createState() =>
_PayToMintPostcardScreenState();
}
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

class _PayToMintPostcardScreenState extends State<PayToMintPostcardScreen> {
final bloc = injector.get<ClaimEmptyPostCardBloc>();
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

@override
void initState() {
super.initState();
bloc.add(GetTokenEvent(widget.claimRequest, createMetadata: true));
}

@override
Widget build(BuildContext context) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return BlocConsumer<ClaimEmptyPostCardBloc, ClaimEmptyPostCardState>(
listener: (context, state) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
if (state.error != null && state.error!.isNotEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.error!),
),
);
}
},
bloc: bloc,
builder: (context, state) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
final artwork = state.assetToken;
if (artwork == null) return Container();
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return PostcardExplain(
payload: PostcardExplainPayload(
artwork,
PostcardButton(
text: "continue".tr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
text: "continue".tr(),
text: 'continue'.tr(),

fontSize: 18,
enabled: state.isClaiming != true,
isProcessing: state.isClaiming == true,
onTap: () {
Navigator.of(context).popAndPushNamed(AppRouter.designStamp,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
arguments: DesignStampPayload(state.assetToken!.copyWith(
owner: widget.claimRequest.address,
tokenId: widget.claimRequest.tokenId)));
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
},
color: POSTCARD_GREEN_BUTTON_COLOR,
),
isPayToMint: true,
),
);
});
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
}

}
7 changes: 1 addition & 6 deletions lib/screen/interactive_postcard/hand_signature_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';

import 'package:autonomy_flutter/common/environment.dart';

Check warning on line 4 in lib/screen/interactive_postcard/hand_signature_page.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/interactive_postcard/hand_signature_page.dart:4:-import 'package:autonomy_flutter/common/environment.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:5:-import 'package:autonomy_flutter/common/injector.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:6:-import 'package:autonomy_flutter/screen/app_router.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:7:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:8:-import 'package:autonomy_flutter/screen/interactive_postcard/stamp_preview.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:9:-import 'package:autonomy_flutter/service/navigation_service.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:10:-import 'package:autonomy_flutter/util/asset_token_ext.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:11:-import 'package:autonomy_flutter/util/constants.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:12:-import 'package:autonomy_flutter/util/geolocation.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:13:-import 'package:autonomy_flutter/util/isolate.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:14:-import 'package:autonomy_flutter/util/log.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:15:-import 'package:autonomy_flutter/util/moma_style_color.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:16:-import 'package:autonomy_flutter/view/back_appbar.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:17:-import 'package:autonomy_flutter/view/postcard_button.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:18:-import 'package:autonomy_theme/style/colors.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:19:-import 'package:easy_localization/easy_localization.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:20:-import 'package:flutter/foundation.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:21:-import 'package:flutter/material.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:22:-import 'package:flutter_svg/svg.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:23:-import 'package:hand_signature/signature.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:24:-import 'package:image/image.dart' as img; lib/screen/interactive_postcard/hand_signature_page.dart:25:-import 'package:nft_collection/models/asset_token.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:26:-import 'package:path_provider/path_provider.dart'; lib/screen/interactive_postcard/hand_signature_page.dart:4:+import "package:autonomy_flutter/common/environment.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:5:+import "package:autonomy_flutter/common/injector.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:6:+import "package:autonomy_flutter/screen/app_router.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:7:+import "package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:8:+import "package:autonomy_flutter/screen/interactive_postcard/stamp_preview.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:9:+import "package:autonomy_flutter/service/navigation_service.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:10:+import "package:autonomy_flutter/util/asset_token_ext.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:11:+import "package:autonomy_flutter/util/constants.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:12:+import "package:autonomy_flutter/util/geolocation.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:13:+import "package:autonomy_flutter/util/isolate.dart"; lib/screen/interactive_postcard/hand_signature_page.dart:14:+import "package:autonomy_flutter/util/log.dart"; lib/screen/
import 'package:autonomy_flutter/common/injector.dart';
import 'package:autonomy_flutter/screen/app_router.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart';
Expand All @@ -16,7 +16,6 @@
import 'package:autonomy_flutter/view/back_appbar.dart';
import 'package:autonomy_flutter/view/postcard_button.dart';
import 'package:autonomy_theme/style/colors.dart';
import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -235,14 +234,10 @@
if (geoLocation == null) return;
final metadataFilename =
'$contractAddress-$tokenId-$counter-metadata.json';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
final claimLocation =
asset.postcardMetadata.locationInformation.lastOrNull ??
moMAGeoLocation.position;
final claimAddress = await claimLocation.getAddress();
final stampAddress = await geoLocation.position.getAddress();
final Map<String, dynamic> metadata = {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
"address": stampAddress, // stamp address
"claimAddress": claimAddress,
"claimAddress": stampAddress,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

"stampedAt": DateTime.now().toIso8601String()
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines 239 to 241
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
"address": stampAddress, // stamp address
"claimAddress": claimAddress,
"claimAddress": stampAddress,
"stampedAt": DateTime.now().toIso8601String()
'address': stampAddress, // stamp address
'claimAddress': stampAddress,
'stampedAt': DateTime.now().toIso8601String()

};
final metadataFile = await _writeMetadata(
Expand Down
51 changes: 44 additions & 7 deletions lib/screen/interactive_postcard/postcard_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
// that can be found in the LICENSE file.
//

import 'dart:async';

Check warning on line 8 in lib/screen/interactive_postcard/postcard_detail_page.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/interactive_postcard/postcard_detail_page.dart:8:-import 'dart:async'; lib/screen/interactive_postcard/postcard_detail_page.dart:9:-import 'dart:collection'; lib/screen/interactive_postcard/postcard_detail_page.dart:10:-import 'dart:convert'; lib/screen/interactive_postcard/postcard_detail_page.dart:11:-import 'dart:io'; lib/screen/interactive_postcard/postcard_detail_page.dart:8:+import "dart:async"; lib/screen/interactive_postcard/postcard_detail_page.dart:9:+import "dart:collection"; lib/screen/interactive_postcard/postcard_detail_page.dart:10:+import "dart:convert"; lib/screen/interactive_postcard/postcard_detail_page.dart:11:+import "dart:io";
import 'dart:collection';
import 'dart:convert';
import 'dart:io';

import 'package:after_layout/after_layout.dart';

Check warning on line 13 in lib/screen/interactive_postcard/postcard_detail_page.dart

View workflow job for this annotation

GitHub Actions / lint the dart code

[dart fix] reported by reviewdog 🐶 Raw Output: lib/screen/interactive_postcard/postcard_detail_page.dart:13:-import 'package:after_layout/after_layout.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:14:-import 'package:autonomy_flutter/common/environment.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:15:-import 'package:autonomy_flutter/common/injector.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:16:-import 'package:autonomy_flutter/model/pair.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:17:-import 'package:autonomy_flutter/model/play_control_model.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:18:-import 'package:autonomy_flutter/screen/app_router.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:19:-import 'package:autonomy_flutter/screen/bloc/accounts/accounts_bloc.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:20:-import 'package:autonomy_flutter/screen/bloc/identity/identity_bloc.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:21:-import 'package:autonomy_flutter/screen/chat/chat_thread_page.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:22:-import 'package:autonomy_flutter/screen/detail/artwork_detail_page.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:23:-import 'package:autonomy_flutter/screen/interactive_postcard/design_stamp.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:24:-import 'package:autonomy_flutter/screen/interactive_postcard/leaderboard/postcard_leaderboard.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:25:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_detail_bloc.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:26:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_detail_state.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:27:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_explain.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:28:-import 'package:autonomy_flutter/screen/interactive_postcard/postcard_view_widget.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:29:-import 'package:autonomy_flutter/screen/interactive_postcard/stamp_preview.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:30:-import 'package:autonomy_flutter/screen/interactive_postcard/travel_info/postcard_travel_info.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:31:-import 'package:autonomy_flutter/screen/interactive_postcard/travel_info/travel_info_bloc.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:32:-import 'package:autonomy_flutter/screen/interactive_postcard/travel_info/travel_info_state.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:33:-import 'package:autonomy_flutter/screen/irl_screen/webview_irl_screen.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:34:-import 'package:autonomy_flutter/screen/settings/help_us/inapp_webview.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:35:-import 'package:autonomy_flutter/service/auth_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:36:-import 'package:autonomy_flutter/service/chat_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:37:-import 'package:autonomy_flutter/service/configuration_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:38:-import 'package:autonomy_flutter/service/metric_client_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:39:-import 'package:autonomy_flutter/service/navigation_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:40:-import 'package:autonomy_flutter/service/postcard_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:41:-import 'package:autonomy_flutter/service/settings_data_service.dart'; lib/screen/interactive_postcard/postcard_detail_page.dart:42:-import 'package:autonom
import 'package:autonomy_flutter/common/environment.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/common/injector.dart';
import 'package:autonomy_flutter/model/pair.dart';
import 'package:autonomy_flutter/model/play_control_model.dart';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
import 'package:autonomy_flutter/model/play_control_model.dart';

Expand All @@ -31,6 +32,7 @@
import 'package:autonomy_flutter/screen/interactive_postcard/travel_info/travel_info_state.dart';
import 'package:autonomy_flutter/screen/irl_screen/webview_irl_screen.dart';
import 'package:autonomy_flutter/screen/settings/help_us/inapp_webview.dart';
import 'package:autonomy_flutter/service/auth_service.dart';
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
import 'package:autonomy_flutter/service/chat_service.dart';
import 'package:autonomy_flutter/service/configuration_service.dart';
import 'package:autonomy_flutter/service/metric_client_service.dart';
Expand Down Expand Up @@ -506,12 +508,8 @@
const SizedBox(
height: 20,
),
if (!isViewOnly) ...[
_postcardAction(context, asset),
const SizedBox(
height: 20,
),
],
_postcardAction(context, asset),
const SizedBox(height: 20),
_postcardInfo(context, asset),
const SizedBox(
height: 20,
Expand Down Expand Up @@ -561,7 +559,14 @@

Widget _postcardAction(BuildContext context, AssetToken asset) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
final theme = Theme.of(context);
if (asset.isCompleted || !asset.isLastOwner || isViewOnly != false) {
final place15StampsText = Text(
"place_15_stamps".tr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
style: theme.textTheme.moMASans400Black12,
);
if (asset.isCompleted) {
return _postcardPhysical(context, asset);
}
if (isViewOnly) {
return const SizedBox();
}
if (asset.isProcessingStamp) {
Expand All @@ -570,6 +575,9 @@
isProcessing: true,
);
}
if (!asset.isLastOwner) {
return place15StampsText;
}
if (!(asset.isStamping || asset.isStamped)) {
final button = PostcardAsyncButton(
text: "continue".tr(),
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -604,6 +612,10 @@
style: theme.textTheme.moMASans400Black12,
),
),
Padding(
padding: const EdgeInsets.only(left: 16, right: 15, top: 10),
child: place15StampsText,
),
];
if (!isSending) {
timer?.cancel();
Expand Down Expand Up @@ -645,6 +657,31 @@
}
}

Widget _postcardPhysical(BuildContext context, AssetToken assetToken) {
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
return Column(
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
children: [
PostcardButton(
text: "unlock_physical_objects".tr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
text: "unlock_physical_objects".tr(),
text: 'unlock_physical_objects'.tr(),

color: POSTCARD_PINK_BUTTON_COLOR,
onTap: () async {
final indexId = assetToken.id;
final jwtToken =
(await injector<AuthService>().getAuthToken()).jwtToken;
final hasCustomerSupport =
_configurationService.hasMerchandiseSupport(indexId);
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
log.info("?indexId=$indexId&hasCS=$hasCustomerSupport");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

Comment on lines +692 to +693
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
_configurationService.hasMerchandiseSupport(indexId);
log.info("?indexId=$indexId&hasCS=$hasCustomerSupport");
_configurationService.hasMerchandiseSupport(indexId);
log.info('?indexId=$indexId&hasCS=$hasCustomerSupport');

if (!context.mounted) return;
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
final url =
"${Environment.merchandiseBaseUrl}?indexId=$indexId&hasCS=$hasCustomerSupport&token=$jwtToken";
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Unnecessary use of double quotes

Navigator.of(context).pushNamed(AppRouter.irlWebView,
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +696 to +697
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dart fix] reported by reviewdog 🐶

Suggested change
"${Environment.merchandiseBaseUrl}?indexId=$indexId&hasCS=$hasCustomerSupport&token=$jwtToken";
Navigator.of(context).pushNamed(AppRouter.irlWebView,
'${Environment.merchandiseBaseUrl}?indexId=$indexId&hasCS=$hasCustomerSupport&token=$jwtToken';
await Navigator.of(context).pushNamed(AppRouter.irlWebView,

arguments: IRLWebScreenPayload(url,
isPlainUI: true, localStorageItems: {'token': jwtToken}));
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Missing a required trailing comma

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 reported by reviewdog 🐶
Missing a required trailing comma

},
),
],
);
}
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved

Widget _postcardInfo(BuildContext context, AssetToken asset) {
return PostcardContainer(
phuocbitmark marked this conversation as resolved.
Show resolved Hide resolved
child: _travelInfoWidget(asset),
Expand Down
Loading
Loading