From c6b77cff97f2256a78bb6302f8f18b91b7c986f7 Mon Sep 17 00:00:00 2001 From: fang yuan Date: Fri, 18 Dec 2020 16:58:18 +0800 Subject: [PATCH] fix bug --- assets/images/starcoin-qr.png | Bin 14851 -> 7811 bytes lib/main.dart | 13 +++++ lib/pages/intro_page.dart | 8 ++- lib/pages/localizations.dart | 83 +++++++++++++++++++++++++++++++ lib/pages/node_page.dart | 90 +++++++++++++++++++++++++--------- macos/Podfile.lock | 4 +- pubspec.yaml | 3 +- 7 files changed, 173 insertions(+), 28 deletions(-) create mode 100644 lib/pages/localizations.dart diff --git a/assets/images/starcoin-qr.png b/assets/images/starcoin-qr.png index 2d1795afa778d45a1ba5f8629369cbeae7cdef77..1b332aa71e9726af48217b8719efc8a87198396f 100644 GIT binary patch literal 7811 zcmV-}9(>`6P)GQr<->te;^{VPF^{?sz&-28gqeSF#5jj=9q99d?$bBMmvxqdb9*?V|Jh|6sH3jbvOM>SNmU!=){R4vYHMYDI%->zxT+Oph`w!Bs==PqHU)m zMPy_oI~2D{bz9Oh@BNspU7yO!+S-=M`>vre(}mag!}10B^W_cllfJdQ`6!X_*{(rGU*pF`j5wgV|-=F_cm^y$^I<38(T^651)`r!34;ph$Wr@uCKsmwDkw#kdH zws$Ef9{1$ddz)n8Ckg%j#j2#-@%Lu^`}os@-2S&_X=?5$i|1>utC#9c=`Ll}ZcZ!z zKb~#P$$}65H{OY9x+^Q#c|lpwiq%QE@F#ULWUsYy@Cns&;PD$}*gosz`6!YpE zQu;of&g9Cc4nbKEe5rIs^SboFsmlMvek%9fA^68s9N+ePcEcV*GBk-uxHhNlOh!L^o9g^D{vi9@8in!SdQYRyBt|T; z-hxFjFBZ>u1IJc*;|^OF+JS{(!~L@_lKMGng#Y^ekK&!)zyG1XuFQ=beCdVDwOQMkinXp%}O#S5+RWMJ_Zj<%Z zDS7kVxcqTie`#y?uNa(a)w=pfd?^-AY1qEH&m`I8$sr~jTk>NWOs+=$i z?Z6Sk{p6ZjUkmQGY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|hpf~68NaBDM0RyfUq~9#?r;p{!G+Jk z?*U7mR?-S43ae-Zh)=!cmldDCFcYmZNT_$M1HTgI-2^V6y>|h5$%1{7yT35>%$t4x z-Z(oMRCQzAZ@yUULX>_Yl!O0fmW7N^IiX0EQzxu>xm}Ce zX9l)@{$)JeJ_ieOix}z42{ML04Y{w_2HXd1pcRk<#t6|UYqPuv9V(zSfD zzyvL2r#)c!?1)YX^2M1O$p{_!wB4+lrfOare@ab1=Ayut&+kS&KkDRiTAIXYNZW^4 z6^pe24ZXjbjncyaeW*?)!`UC)okHSV&XG@>IXAwj@qV~_)-T({f-X|@JMoc}+UKi< zTNlCETgz(k0K*Xx;d_~>23phsx5-Wi3vUA`FncCV%6)N@$-jLk0ke)Lnh;`@fq4)= d!LctL13C#$oN*HYZgq0#-ZQ*geCNsQ{{evYH}U`g diff --git a/lib/main.dart b/lib/main.dart index 6b58dcd..b1e6bc5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,8 +2,10 @@ import 'package:flutter/material.dart'; import 'package:redux/redux.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:starcoin_node/pages/localizations.dart'; import 'package:starcoin_node/pages/main_page.dart'; import 'package:starcoin_node/style/themes.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; import 'config/states.dart'; import 'pages/routes/page.dart'; @@ -42,6 +44,17 @@ class App extends StatelessWidget { child: _buildGlobalLoading(context), ), new MaterialApp( + localizationsDelegates: [ + // 本地化的代理类 + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + StarcoinLocalizationsDelegate(), + ], + supportedLocales: [ + const Locale('en', 'US'), // 美国英语 + const Locale('zh', 'CN'), // 中文简体 + //其它Locales + ], theme: store.state.theme.themeData, routes: _buildRoutes(), home: new MainPage(userName), diff --git a/lib/pages/intro_page.dart b/lib/pages/intro_page.dart index 7774afa..2c069ab 100644 --- a/lib/pages/intro_page.dart +++ b/lib/pages/intro_page.dart @@ -3,6 +3,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:starcoin_node/pages/node_page.dart'; import 'package:starcoin_node/pages/routes/routes.dart'; +import 'localizations.dart'; + class IntroPage extends StatelessWidget { static const String routeName = Routes.main + "/intro"; @@ -38,7 +40,8 @@ class IntroPage extends StatelessWidget { BorderRadius.all(Radius.circular(4)), borderSide: BorderSide(width: 1, color: blue), ), - hintText: '创建昵称'), + hintText: StarcoinLocalizations.of(context) + .createNickyName), )), SizedBox( height: 20, @@ -54,7 +57,8 @@ class IntroPage extends StatelessWidget { return new NodePage(name); })); }, - child: const Text('确认', style: TextStyle(fontSize: 30)), + child: Text(StarcoinLocalizations.of(context).confirm, + style: TextStyle(fontSize: 30)), shape: RoundedRectangleBorder( borderRadius: new BorderRadius.circular(20.0), side: BorderSide(color: blue), diff --git a/lib/pages/localizations.dart b/lib/pages/localizations.dart new file mode 100644 index 0000000..cc609a1 --- /dev/null +++ b/lib/pages/localizations.dart @@ -0,0 +1,83 @@ +//Locale资源类 +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +class StarcoinLocalizations { + StarcoinLocalizations(this.isZh); + //是否为中文 + bool isZh = false; + //为了使用方便,我们定义一个静态方法 + static StarcoinLocalizations of(BuildContext context) { + return Localizations.of( + context, StarcoinLocalizations); + } + + //Locale相关值,title为应用标题 + String get title { + return isZh ? "Starcoin 挖矿程序" : "Starcoin Miner"; + } + + String get slogon { + return isZh ? "参与测试网挖矿 瓜分万U!" : "Start Mining Win10K USDT/STC!"; + } + + String get currentTask { + return isZh ? "当前任务" : "Current Task"; + } + + String get progress { + return isZh ? "进度" : "Progress"; + } + + String get balance { + return isZh ? "当前余额" : "Balance"; + } + + String get minedBlocks { + return isZh ? "已挖块数" : "Mined"; + } + + String get blockUnit { + return isZh ? "块" : "Blocks"; + } + + String get currentDiff { + return isZh ? "当前难度" : "Current Difficulty"; + } + + String get createNickyName { + return isZh ? "创建昵称" : "Create Nicky Name"; + } + + String get confirm { + return isZh ? "确认" : "Confirm"; + } + + String get generatePoster { + return isZh ? "生成海报" : "Share Poster"; + } + + String get offcialWebSite { + return isZh ? "官网" : "Offcial Website"; + } +} + +class StarcoinLocalizationsDelegate + extends LocalizationsDelegate { + const StarcoinLocalizationsDelegate(); + + //是否支持某个Local + @override + bool isSupported(Locale locale) => ['en', 'zh'].contains(locale.languageCode); + + // Flutter会调用此类加载相应的Locale资源类 + @override + Future load(Locale locale) { + print("$locale"); + return SynchronousFuture( + StarcoinLocalizations(locale.languageCode == "zh")); + } + + @override + bool shouldReload(StarcoinLocalizationsDelegate old) => false; +} diff --git a/lib/pages/node_page.dart b/lib/pages/node_page.dart index b96b1df..a66e363 100644 --- a/lib/pages/node_page.dart +++ b/lib/pages/node_page.dart @@ -8,6 +8,7 @@ import 'package:starcoin_wallet/wallet/node.dart'; import 'dart:io'; import 'dart:convert'; import 'directory_service.dart'; +import 'localizations.dart'; import 'routes/routes.dart'; import 'package:date_format/date_format.dart'; import "package:path/path.dart" show join; @@ -39,6 +40,9 @@ class _NodePageState extends State with TickerProviderStateMixin { List lines = List(); String address = "0x0fb6d936ddc01ecb151d73d43c545251"; + String taskName = ""; + String percent = ""; + String userName; GlobalKey previewContainer = new GlobalKey(); @@ -188,23 +192,32 @@ class _NodePageState extends State with TickerProviderStateMixin { 'assets/images/starcoin-miner.png', width: 50, ), - Text( - "参与测试网挖矿 瓜分万U!", - style: TextStyle(color: Colors.white, fontSize: 20), - ), + Column(children: [ + Text(StarcoinLocalizations.of(context).slogon, + style: TextStyle( + color: Colors.white, fontSize: 15)), + Text( + StarcoinLocalizations.of(context) + .offcialWebSite + + ': starcoin.org', + style: TextStyle(color: blue, fontSize: 15)), + ]), Expanded( flex: 1, child: Container( margin: EdgeInsets.only(right: 20), alignment: Alignment.centerRight, - child: IconButton( - icon: Image.asset( - 'assets/images/starcoin-save.png'), - iconSize: 60, - onPressed: () async { - await takescrshot(); - }, - ))), + child: Tooltip( + message: StarcoinLocalizations.of(context) + .generatePoster, + child: IconButton( + icon: Image.asset( + 'assets/images/starcoin-save.png'), + iconSize: 60, + onPressed: () async { + await takescrshot(); + }, + )))), ], ), Container( @@ -212,13 +225,32 @@ class _NodePageState extends State with TickerProviderStateMixin { alignment: Alignment(0, 0), child: Center( child: Column(children: [ - Container( - margin: EdgeInsets.only(bottom: 10), - alignment: Alignment.centerRight, - child: Text( - time, - style: TextStyle(color: blue, fontSize: 15), - )), + Row(children: [ + Container( + margin: EdgeInsets.only(bottom: 10), + child: Text( + StarcoinLocalizations.of(context) + .currentTask + + ":$taskName", + style: TextStyle(color: blue, fontSize: 13), + )), + Container( + margin: EdgeInsets.only(bottom: 10, left: 10), + child: Text( + StarcoinLocalizations.of(context).progress + + ":$percent%", + style: TextStyle(color: blue, fontSize: 13), + )), + Expanded( + child: Container( + margin: EdgeInsets.only(bottom: 10), + alignment: Alignment.centerRight, + child: Text( + time, + style: + TextStyle(color: blue, fontSize: 13), + ))) + ]), Container( padding: EdgeInsets.only( left: 20, right: 20, top: 10, bottom: 10), @@ -251,7 +283,7 @@ class _NodePageState extends State with TickerProviderStateMixin { height: iconSize, ), Text( - "当前余额", + StarcoinLocalizations.of(context).balance, style: blueTextstyle, ), Container( @@ -272,14 +304,18 @@ class _NodePageState extends State with TickerProviderStateMixin { height: iconSize, ), Text( - "已挖块数", + StarcoinLocalizations.of(context) + .minedBlocks, style: blueTextstyle, ), Container( padding: edgeTexts, child: Text("$blocks", style: whiteTextstyle)), - Text("块", style: blueTextstyle) + Text( + StarcoinLocalizations.of(context) + .blockUnit, + style: blueTextstyle) ], )), SizedBox(height: 5), @@ -292,7 +328,10 @@ class _NodePageState extends State with TickerProviderStateMixin { width: iconSize, height: iconSize, ), - Text("当前难度", style: blueTextstyle), + Text( + StarcoinLocalizations.of(context) + .currentDiff, + style: blueTextstyle), Container( padding: edgeTexts, child: Text(difficulty, @@ -337,10 +376,15 @@ class _NodePageState extends State with TickerProviderStateMixin { final totalDifficulty = nodeInfo['peer_info']['chain_info']['total_difficulty']; + final syncProgress = await node.syncProgress(); + final taskNames = syncProgress['current']['task_name'].split("::"); + setState(() { this.address = address.toString(); this.balance = balance.toBigInt() / BigInt.from(1000000000); this.difficulty = totalDifficulty; + this.taskName = taskNames[taskNames.length - 1]; + this.percent = syncProgress['current']['percent'].toStringAsFixed(2); }); } }); diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 307fc03..f779ef3 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -5,13 +5,13 @@ PODS: - FlutterMacOS DEPENDENCIES: - - FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64-release`) + - FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`) - shared_preferences (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences/macos`) - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) EXTERNAL SOURCES: FlutterMacOS: - :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64-release + :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64 shared_preferences: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences/macos shared_preferences_macos: diff --git a/pubspec.yaml b/pubspec.yaml index 363d722..d47bb40 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,6 +23,8 @@ environment: dependencies: flutter: sdk: flutter + flutter_localizations: + sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -30,7 +32,6 @@ dependencies: provider: ^3.1.0+1 hex: ^0.1.2 shared_preferences: ^0.5.6+1 - intl: ^0.16.1 flutter_spinkit: "^4.1.1+1" flutter_hooks: ^0.9.0 built_value: ^7.1.0