@@ -9,6 +9,8 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
99// import 'package:tencent_kit/tencent_kit.dart';
1010import 'package:wechat_kit/wechat_kit.dart' ;
1111
12+ import 'package:openiothub_common_pages/openiothub_common_pages.dart' ;
13+
1214class AppInfoPage extends StatefulWidget {
1315 AppInfoPage ({required Key key}) : super (key: key);
1416
@@ -32,16 +34,18 @@ class _AppInfoPageState extends State<AppInfoPage> {
3234 // 微信分享
3335 late final StreamSubscription <WechatResp > _share;
3436
37+ String share_success = "share success" ;
38+ String share_failed = "share failed" ;
3539 // QQ分享
3640 // late final StreamSubscription<TencentResp> _respSubs;
3741 // TencentLoginResp? _loginResp;
3842
3943 void _listenShareMsg (WechatResp resp) {
4044 // final String content = 'share: ${resp.errorCode} ${resp.errorMsg}';
4145 if (resp.errorCode == 0 ) {
42- showToast ("分享成功!" );
46+ showToast (share_success );
4347 } else {
44- showToast ("分享失败!" );
48+ showToast (share_failed );
4549 }
4650 }
4751
@@ -79,11 +83,11 @@ class _AppInfoPageState extends State<AppInfoPage> {
7983 @override
8084 Widget build (BuildContext context) {
8185 final List _result = [];
82- _result.add ("App名称: $appName " );
83- _result.add ("包名: $packageName " );
84- _result.add ("版本: $version " );
85- _result.add ("版本号: $buildNumber " );
86- _result.add ("APP备案号: 皖ICP备2022013511号-2A" );
86+ _result.add ("${ OpenIoTHubCommonLocalizations . of ( context ). app_name } $appName " );
87+ _result.add ("${ OpenIoTHubCommonLocalizations . of ( context ). package_name } $packageName " );
88+ _result.add ("${ OpenIoTHubCommonLocalizations . of ( context ). version } $version " );
89+ _result.add ("${ OpenIoTHubCommonLocalizations . of ( context ). version_sn } $buildNumber " );
90+ _result.add ("${ OpenIoTHubCommonLocalizations . of ( context ). icp_number } 皖ICP备2022013511号-2A" );
8791
8892 final tiles = _result.map (
8993 (pair) {
@@ -97,7 +101,7 @@ class _AppInfoPageState extends State<AppInfoPage> {
97101 List <ListTile > tilesList = tiles.toList ();
98102 tilesList.add (ListTile (
99103 title: Text (
100- "反馈渠道" ,
104+ OpenIoTHubCommonLocalizations . of (context).feedback_channels ,
101105 style: TextStyle (color: Colors .green),
102106 ),
103107 onTap: () {
@@ -111,7 +115,7 @@ class _AppInfoPageState extends State<AppInfoPage> {
111115 ));
112116 tilesList.add (ListTile (
113117 title: Text (
114- "在线反馈" ,
118+ OpenIoTHubCommonLocalizations . of (context).online_feedback ,
115119 style: TextStyle (color: Colors .green),
116120 ),
117121 onTap: () {
@@ -120,12 +124,12 @@ class _AppInfoPageState extends State<AppInfoPage> {
120124 ));
121125 tilesList.add (ListTile (
122126 title: Text (
123- "隐私政策" ,
127+ OpenIoTHubCommonLocalizations . of (context).privacy_policy ,
124128 style: TextStyle (color: Colors .green),
125129 ),
126130 onTap: () {
127131 goToURL (context, "https://docs.iothub.cloud/privacyPolicy/index.html" ,
128- "隐私政策" );
132+ OpenIoTHubCommonLocalizations . of (context).privacy_policy );
129133 },
130134 ));
131135 final divided = ListTile .divideTiles (
@@ -134,7 +138,7 @@ class _AppInfoPageState extends State<AppInfoPage> {
134138 ).toList ();
135139
136140 return Scaffold (
137- appBar: AppBar (title: Text ("App信息" ), actions: < Widget > [
141+ appBar: AppBar (title: Text (OpenIoTHubCommonLocalizations . of (context).app_info ), actions: < Widget > [
138142 IconButton (
139143 icon: Icon (
140144 Icons .share,
@@ -160,27 +164,27 @@ class _AppInfoPageState extends State<AppInfoPage> {
160164 }
161165
162166 _shareAction () async {
163- var title = "云亿连内网穿透和智能家居管理" ;
164- var description = "云亿连全平台管理您的所有智能设备和私有云" ;
167+ var title = OpenIoTHubCommonLocalizations . of (context).share_app_title ;
168+ var description = OpenIoTHubCommonLocalizations . of (context).share_app_description ;
165169 var url = "https://m.malink.cn/s/RNzqia" ;
166170 showDialog (
167171 context: context,
168172 builder: (_) => AlertDialog (
169- title: Text ("分享" ),
170- content: Text ("选择需方分享的位置" ),
173+ title: Text (OpenIoTHubCommonLocalizations . of (context).share ),
174+ content: Text (OpenIoTHubCommonLocalizations . of (context).share_to_where ),
171175 actions: < Widget > [
172176 Row (
173177 children: [
174178 TDButton (
175179 icon: TDIcons .logo_wechat_stroke,
176- text: '分享到微信' ,
180+ text: OpenIoTHubCommonLocalizations . of (context).share_to_wechat ,
177181 size: TDButtonSize .small,
178182 type: TDButtonType .outline,
179183 shape: TDButtonShape .rectangle,
180184 theme: TDButtonTheme .primary,
181185 onTap: () async {
182186 if (! await WechatKitPlatform .instance.isInstalled ()) {
183- showToast ("微信未安装!" );
187+ showToast (OpenIoTHubCommonLocalizations . of (context).wechat_not_installed );
184188 return ;
185189 }
186190 WechatKitPlatform .instance.shareWebpage (
@@ -197,15 +201,15 @@ class _AppInfoPageState extends State<AppInfoPage> {
197201 padding: const EdgeInsets .only (left: 10.0 ), // 设置左边距离
198202 child: TDButton (
199203 icon: TDIcons .logo_wechat_stroke,
200- text: '分享到朋友圈' ,
204+ text: OpenIoTHubCommonLocalizations . of (context).share_on_moments ,
201205 size: TDButtonSize .small,
202206 type: TDButtonType .outline,
203207 shape: TDButtonShape .rectangle,
204208 theme: TDButtonTheme .primary,
205209 onTap: () async {
206210 if (! await WechatKitPlatform .instance
207211 .isInstalled ()) {
208- showToast ("微信未安装!" );
212+ showToast (OpenIoTHubCommonLocalizations . of (context).wechat_not_installed );
209213 return ;
210214 }
211215 WechatKitPlatform .instance.shareWebpage (
0 commit comments