Skip to content

Commit

Permalink
fix qr scan
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingCoding committed Jun 11, 2023
1 parent f9505a0 commit 29f44d5
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
Expand Down
11 changes: 7 additions & 4 deletions lib/page/common/add_contacts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ class _AddContactsPage extends State<AddContactsPage> {
if (res != null) {
// 判断 res 是否是一个 json 字符串
bool isJosn = TransactionHelper.isJson(res);
String address = res;
Map<String, dynamic> json = {};
String address = "";
if (isJosn) {
json = const JsonDecoder().convert(res);
address = json["address"] ?? "";
bool flag1 = TransactionHelper.checkAddress(address);
if (!flag1) {
if (isJosn) {
json = const JsonDecoder().convert(res);
address = json["address"] ?? "";
}
}
bool flag = TransactionHelper.checkAddress(address);
if (flag) {
Expand Down
1 change: 1 addition & 0 deletions lib/page/common/back_up_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BackUpPage extends StatelessWidget {
args = ModalRoute.of(context)!.settings.arguments as BackUpPageRouteParams;
}
if (args.type == 0) {
// print(args.data);
var mnemonicList = args.data.trim().split(' ');
mnemonicList.asMap().forEach((index, value) {
mnemonicItemList.add(MnemonicItem(index + 1, value));
Expand Down
11 changes: 7 additions & 4 deletions lib/page/detail/contacts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ class ContactsStatePage extends State<ContactsPage> {
if (res != null) {
// 判断 res 是否是一个 json 字符串
bool isJosn = TransactionHelper.isJson(res);
String address = res;
Map<String, dynamic> json = {};
String address = "";
if (isJosn) {
json = const JsonDecoder().convert(res);
address = json["address"] ?? "";
bool flag1 = TransactionHelper.checkAddress(address);
if (!flag1) {
if (isJosn) {
json = const JsonDecoder().convert(res);
address = json["address"] ?? "";
}
}
bool flag = TransactionHelper.checkAddress(address);
if (flag) {
Expand Down
4 changes: 3 additions & 1 deletion lib/page/wallet/wallet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class WalletPageState extends State<WalletPage> {
"id": 1
});
walletModal.setBlance(responseBalance.data['result']);
// print("$explorURL/block/${wallet.address}?addresses_page=$currentPage&addresses_per_page=100");
Response response = await dio.get(
"$explorURL/block/${wallet.address}?addresses_page=$currentPage&addresses_per_page=100",
cancelToken: cancelToken,
Expand Down Expand Up @@ -146,13 +147,14 @@ class WalletPageState extends State<WalletPage> {
List<Transaction> newList2 = [];
newList2.addAll(allList);
String lastTime = "";
for (var i = 0; i < allList.length - 1; i++) {
for (var i = 0; i < allList.length; i++) {
var transaction = allList[i];
if (lastTime == "" || lastTime.substring(0, 7) != transaction.time.substring(0, 7)) {
lastTime = transaction.time;
newList2.insert(i, Transaction(type: 2, time: transaction.time, amount: '', address: '', status: "", from: '', to: '', hash: '', blockAddress: '', fee: 0, remark: ""));
}
}
// print(newList2);
if (mounted) {
setState(() {
list = newList2;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.15+16
version: 1.0.19+20

environment:
sdk: '>=2.19.2 <3.0.0'
Expand Down

0 comments on commit 29f44d5

Please sign in to comment.