mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-22 06:28:39 +02:00
Merge branch 'main' into bulgarian_support
This commit is contained in:
@@ -57,7 +57,7 @@ class AnyPayPayment {
|
||||
|
||||
List<String> get outAddresses {
|
||||
return instructions
|
||||
.map((instuction) => instuction.outputs.map((out) => out.address))
|
||||
.map((instruction) => instruction.outputs.map((out) => out.address))
|
||||
.expand((e) => e)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ class WalletLoadingService {
|
||||
final wallet = await walletService.openWallet(name, password);
|
||||
|
||||
if (type == WalletType.monero) {
|
||||
await upateMoneroWalletPassword(wallet);
|
||||
await updateMoneroWalletPassword(wallet);
|
||||
}
|
||||
|
||||
return wallet;
|
||||
}
|
||||
|
||||
Future<void> upateMoneroWalletPassword(WalletBase wallet) async {
|
||||
Future<void> updateMoneroWalletPassword(WalletBase wallet) async {
|
||||
final key = PreferencesKey.moneroWalletUpdateV1Key(wallet.name);
|
||||
var isPasswordUpdated = sharedPreferences.getBool(key) ?? false;
|
||||
|
||||
@@ -37,8 +37,8 @@ class WalletLoadingService {
|
||||
}
|
||||
|
||||
final password = generateWalletPassword();
|
||||
// Save new generated password with backup key for case
|
||||
// if wallet will change password, but it will faild to updated in secure storage
|
||||
// Save new generated password with backup key for case where
|
||||
// wallet will change password, but it will fail to update in secure storage
|
||||
final bakWalletName = '#__${wallet.name}_bak__#';
|
||||
await keyService.saveWalletPassword(walletName: bakWalletName, password: password);
|
||||
await wallet.changePassword(password);
|
||||
|
||||
@@ -23,7 +23,8 @@ class LanguageService {
|
||||
'ar': 'العربية (Arabic)',
|
||||
'tr': 'Türkçe (Turkish)',
|
||||
'my': 'မြန်မာ (Burmese)',
|
||||
'bg': 'Български (Bulgarian)'
|
||||
'bg': 'Български (Bulgarian)',
|
||||
'ur': 'اردو (Urdu)'
|
||||
};
|
||||
|
||||
static const Map<String, String> localeCountryCode = {
|
||||
@@ -46,7 +47,8 @@ class LanguageService {
|
||||
'ar': 'sau',
|
||||
'tr': 'tur',
|
||||
'my': 'mmr',
|
||||
'bg': 'bgr'
|
||||
'bg': 'bgr',
|
||||
'ur': 'pak'
|
||||
};
|
||||
|
||||
static final list = <String, String> {};
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import 'dart:io';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/utils/share_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:cross_file/cross_file.dart';
|
||||
import 'package:cake_wallet/utils/show_bar.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
@@ -110,7 +109,7 @@ class BackupPage extends BasePage {
|
||||
if (Platform.isAndroid) {
|
||||
onExportAndroid(context, backup);
|
||||
} else {
|
||||
await share(backup);
|
||||
await share(backup, context);
|
||||
}
|
||||
},
|
||||
actionLeftButton: () => Navigator.of(dialogContext).pop());
|
||||
@@ -140,18 +139,14 @@ class BackupPage extends BasePage {
|
||||
},
|
||||
actionLeftButton: () async {
|
||||
Navigator.of(dialogContext).pop();
|
||||
await share(backup);
|
||||
await share(backup, context);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> share(BackupExportFile backup) async {
|
||||
const mimeType = 'application/*';
|
||||
Future<void> share(BackupExportFile backup, BuildContext context) async {
|
||||
final path = await backupViewModelBase.saveBackupFileLocally(backup);
|
||||
await Share.shareXFiles(<XFile>[XFile(
|
||||
path,
|
||||
name: backup.name,
|
||||
mimeType: mimeType)]);
|
||||
await ShareUtil.shareFile(filePath: path, fileName: backup.name, context: context);
|
||||
await backupViewModelBase.removeBackupFileLocally(backup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/themes/theme_base.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
|
||||
@@ -229,7 +228,8 @@ class DashboardPage extends BasePage {
|
||||
}
|
||||
|
||||
await Future<void>.delayed(Duration(seconds: 1));
|
||||
await showPopUp<void>(
|
||||
if (context.mounted) {
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithOneAction(
|
||||
@@ -239,6 +239,7 @@ class DashboardPage extends BasePage {
|
||||
buttonText: S.of(context).understand,
|
||||
buttonAction: () => Navigator.of(context).pop());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var needToPresentYat = false;
|
||||
|
||||
@@ -117,7 +117,8 @@ class AddressPage extends BasePage {
|
||||
}
|
||||
|
||||
await Future<void>.delayed(Duration(seconds: 1));
|
||||
await showPopUp<void>(
|
||||
if (context.mounted) {
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithTwoActions(
|
||||
@@ -131,6 +132,7 @@ class AddressPage extends BasePage {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return KeyboardActions(
|
||||
|
||||
@@ -379,7 +379,8 @@ class SendPage extends BasePage {
|
||||
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showPopUp<void>(
|
||||
if (context.mounted) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ConfirmSendingAlert(
|
||||
@@ -423,6 +424,7 @@ class SendPage extends BasePage {
|
||||
},
|
||||
actionLeftButton: () => Navigator.of(context).pop());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ class SettingsLinkProviderCell extends StandardListRow {
|
||||
color: Palette.blueCraiola));
|
||||
|
||||
static void _launchUrl(String url) async {
|
||||
if (await canLaunch(url)) await launch(url, forceSafariVC: false);
|
||||
try {
|
||||
await launch(url, forceSafariVC: false);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ class ExceptionHandler {
|
||||
"errno = 9", // SocketException: Bad file descriptor
|
||||
"errno = 32", // SocketException: Write failed (OS Error: Broken pipe)
|
||||
"errno = 60", // SocketException: Operation timed out
|
||||
"errno = 110", // SocketException: Connection timed out
|
||||
"errno = 54", // SocketException: Connection reset by peer
|
||||
"errno = 49", // SocketException: Can't assign requested address
|
||||
"errno = 28", // OS Error: No space left on device
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:cross_file/cross_file.dart';
|
||||
|
||||
class ShareUtil {
|
||||
static void share({required String text, required BuildContext context}) {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
static const _mimeType = 'application/*';
|
||||
|
||||
static void share({required String text, required BuildContext context}) {
|
||||
Share.share(
|
||||
text,
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
sharePositionOrigin: _sharePosition(context),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> shareFile({
|
||||
required String filePath,
|
||||
required String fileName,
|
||||
required BuildContext context,
|
||||
}) async {
|
||||
Share.shareXFiles(
|
||||
<XFile>[
|
||||
XFile(
|
||||
filePath,
|
||||
name: fileName,
|
||||
mimeType: _mimeType,
|
||||
)
|
||||
],
|
||||
sharePositionOrigin: _sharePosition(context),
|
||||
);
|
||||
}
|
||||
|
||||
static Rect? _sharePosition(BuildContext context) {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
|
||||
return box!.localToGlobal(Offset.zero) & box.size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:cake_wallet/wallet_type_utils.dart';
|
||||
import 'package:cake_wallet/wallet_type_utils.dart';
|
||||
|
||||
part 'support_view_model.g.dart';
|
||||
|
||||
@@ -19,7 +18,9 @@ abstract class SupportViewModelBase with Store {
|
||||
RegularListItem(
|
||||
title: S.current.faq,
|
||||
handler: (BuildContext context) async {
|
||||
if (await canLaunch(url)) await launch(url);
|
||||
try {
|
||||
await launch(url);
|
||||
} catch (e) {}
|
||||
},
|
||||
),
|
||||
LinkListItem(
|
||||
|
||||
Reference in New Issue
Block a user