Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Apr 19, 2021
2 parents 3a813b5 + 8adde5a commit bd4c586
Show file tree
Hide file tree
Showing 33 changed files with 1,779 additions and 786 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@
# 2.0.2-beta
- Add ChainX network support.
- Hide tips by default in tx confirm page.
- Fix known Bugs.

# 2.0.3-beta
- Add Edgeware network support.
- Update ChainX plugin.
- Update Laminar plugin to TC3.
- Fix known Bugs.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -370,7 +370,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.2;
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -493,7 +493,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -509,7 +509,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.2;
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -526,7 +526,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -542,7 +542,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.2;
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
32 changes: 23 additions & 9 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:app/pages/account/import/importAccountPage.dart';
import 'package:app/pages/assets/asset/assetPage.dart';
import 'package:app/pages/assets/transfer/detailPage.dart';
import 'package:app/pages/assets/transfer/transferPage.dart';
import 'package:app/pages/guidePage.dart';
import 'package:app/pages/public/guidePage.dart';
import 'package:app/pages/homePage.dart';
import 'package:app/pages/networkSelectPage.dart';
import 'package:app/pages/profile/aboutPage.dart';
Expand All @@ -28,7 +28,8 @@ import 'package:app/pages/profile/recovery/vouchRecoveryPage.dart';
import 'package:app/pages/profile/settings/remoteNodeListPage.dart';
import 'package:app/pages/profile/settings/settingsPage.dart';
import 'package:app/pages/profile/account/signPage.dart';
import 'package:app/pages/public/karPreAuctionPage.dart';
import 'package:app/pages/public/karCrowdLoanFormPage.dart';
import 'package:app/pages/public/karCrowdLoanPage.dart';
import 'package:app/pages/walletConnect/walletConnectSignPage.dart';
import 'package:app/pages/walletConnect/wcPairingConfirmPage.dart';
import 'package:app/pages/walletConnect/wcSessionsPage.dart';
Expand Down Expand Up @@ -58,8 +59,9 @@ import 'package:polkawallet_ui/pages/txConfirmPage.dart';
const get_storage_container = 'configuration';

class WalletApp extends StatefulWidget {
WalletApp(this.plugins);
WalletApp(this.plugins, this.buildTarget);
final List<PolkawalletPlugin> plugins;
final BuildTargets buildTarget;
@override
_WalletAppState createState() => _WalletAppState();
}
Expand Down Expand Up @@ -202,7 +204,7 @@ class _WalletAppState extends State<WalletApp> {
: null,
);

final service = AppService(network, _keyring, _store);
final service = AppService(network, _keyring, _store, widget.buildTarget);
service.init();
setState(() {
_service = service;
Expand All @@ -213,6 +215,13 @@ class _WalletAppState extends State<WalletApp> {
_service.assets.fetchMarketPrice();
}

Future<void> _changeToKusamaForKar() async {
final name = 'kusama';
await _changeNetwork(
widget.plugins.firstWhere((e) => e.basic.name == name));
_service.store.assets.loadCache(_keyring.current, name);
}

Future<void> _changeNode(NetworkParams node) async {
if (_connectedNode != null) {
setState(() {
Expand All @@ -228,7 +237,7 @@ class _WalletAppState extends State<WalletApp> {

Future<void> _checkUpdate(BuildContext context) async {
final versions = await WalletApi.getLatestVersion();
AppUI.checkUpdate(context, versions, autoCheck: true);
AppUI.checkUpdate(context, versions, widget.buildTarget, autoCheck: true);
}

Future<void> _checkJSCodeUpdate(
Expand Down Expand Up @@ -283,7 +292,10 @@ class _WalletAppState extends State<WalletApp> {
final pluginIndex = widget.plugins
.indexWhere((e) => e.basic.name == store.settings.network);
final service = AppService(
widget.plugins[pluginIndex > -1 ? pluginIndex : 0], _keyring, store);
widget.plugins[pluginIndex > -1 ? pluginIndex : 0],
_keyring,
store,
widget.buildTarget);
service.init();
setState(() {
_store = store;
Expand Down Expand Up @@ -344,8 +356,8 @@ class _WalletAppState extends State<WalletApp> {
builder: (_, AsyncSnapshot<int> snapshot) {
if (snapshot.hasData && _service != null) {
return snapshot.data > 0
? HomePage(
_service, _connectedNode, _checkJSCodeUpdate)
? HomePage(_service, _connectedNode,
_checkJSCodeUpdate, _changeToKusamaForKar)
: CreateAccountEntryPage();
} else {
return Container(color: Theme.of(context).canvasColor);
Expand All @@ -370,7 +382,9 @@ class _WalletAppState extends State<WalletApp> {
WalletConnectSignPage.route: (_) =>
WalletConnectSignPage(_service, _service.account.getPassword),
GuidePage.route: (_) => GuidePage(),
KarPreAuctionPage.route: (_) => KarPreAuctionPage(_service),
KarCrowdLoanPage.route: (_) => KarCrowdLoanPage(_service, _connectedNode),
KarCrowdLoanFormPage.route: (_) =>
KarCrowdLoanFormPage(_service, _connectedNode),

/// account
CreateAccountEntryPage.route: (_) => CreateAccountEntryPage(),
Expand Down
5 changes: 3 additions & 2 deletions lib/common/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ const prefixList = [
];

/// app versions
const String app_beta_version = 'v2.0.2-beta.2';
const int app_beta_version_code = 2022;
enum BuildTargets { apk, playStore, dev }
const String app_beta_version = 'v2.0.3-beta.2';
const int app_beta_version_code = 2032;

const show_guide_status_key = 'show_guide_status';
const show_banner_status_key = 'show_banner_status';
25 changes: 25 additions & 0 deletions lib/main-dev.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:app/app.dart';
import 'package:app/common/consts.dart';
import 'package:flutter/material.dart';
import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
import 'package:polkawallet_plugin_acala/polkawallet_plugin_acala.dart';
import 'package:polkawallet_plugin_laminar/polkawallet_plugin_laminar.dart';
import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
import 'package:polkawallet_plugin_edgeware/polkawallet_plugin_edgeware.dart';

import 'package:get_storage/get_storage.dart';

void main() async {
await GetStorage.init(get_storage_container);

final _plugins = [
PluginKusama(name: 'polkadot'),
PluginKusama(),
PluginAcala(),
PluginLaminar(),
PluginChainX(),
PluginEdgeware(),
];

runApp(WalletApp(_plugins, BuildTargets.dev));
}
25 changes: 25 additions & 0 deletions lib/main-google.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:app/app.dart';
import 'package:app/common/consts.dart';
import 'package:flutter/material.dart';
import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
import 'package:polkawallet_plugin_acala/polkawallet_plugin_acala.dart';
import 'package:polkawallet_plugin_laminar/polkawallet_plugin_laminar.dart';
import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
import 'package:polkawallet_plugin_edgeware/polkawallet_plugin_edgeware.dart';

import 'package:get_storage/get_storage.dart';

void main() async {
await GetStorage.init(get_storage_container);

final _plugins = [
PluginKusama(name: 'polkadot'),
PluginKusama(),
PluginAcala(),
PluginLaminar(),
PluginChainX(),
PluginEdgeware(),
];

runApp(WalletApp(_plugins, BuildTargets.playStore));
}
9 changes: 5 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:app/app.dart';
import 'package:app/common/consts.dart';
import 'package:flutter/material.dart';
import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
import 'package:polkawallet_plugin_acala/polkawallet_plugin_acala.dart';
// import 'package:polkawallet_plugin_edgeware/polkawallet_plugin_edgeware.dart';
import 'package:polkawallet_plugin_laminar/polkawallet_plugin_laminar.dart';
import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
import 'package:polkawallet_plugin_edgeware/polkawallet_plugin_edgeware.dart';

import 'package:get_storage/get_storage.dart';
import 'package:polkawallet_plugin_laminar/polkawallet_plugin_laminar.dart';

void main() async {
await GetStorage.init(get_storage_container);
Expand All @@ -17,8 +18,8 @@ void main() async {
PluginAcala(),
PluginLaminar(),
PluginChainX(),
// PluginEdgeware(),
PluginEdgeware(),
];

runApp(WalletApp(_plugins));
runApp(WalletApp(_plugins, BuildTargets.apk));
}
Loading

0 comments on commit bd4c586

Please sign in to comment.