ChadCSong

修改国际化方式,增加multidex支持

...@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' ...@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
26 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 27
28 android { 28 android {
29 - compileSdkVersion 30 29 + compileSdkVersion 33
30 30
31 compileOptions { 31 compileOptions {
32 sourceCompatibility JavaVersion.VERSION_1_8 32 sourceCompatibility JavaVersion.VERSION_1_8
...@@ -46,6 +46,7 @@ android { ...@@ -46,6 +46,7 @@ android {
46 applicationId "com.mofunsky.one_poem" 46 applicationId "com.mofunsky.one_poem"
47 minSdkVersion 20 47 minSdkVersion 20
48 targetSdkVersion 30 48 targetSdkVersion 30
49 + multiDexEnabled true
49 versionCode flutterVersionCode.toInteger() 50 versionCode flutterVersionCode.toInteger()
50 versionName flutterVersionName 51 versionName flutterVersionName
51 } 52 }
......
1 +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
1 #include "Generated.xcconfig" 2 #include "Generated.xcconfig"
......
1 +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
1 #include "Generated.xcconfig" 2 #include "Generated.xcconfig"
......
...@@ -2,6 +2,7 @@ import 'package:flustars/flustars.dart'; ...@@ -2,6 +2,7 @@ import 'package:flustars/flustars.dart';
2 import 'package:flutter/foundation.dart'; 2 import 'package:flutter/foundation.dart';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter/services.dart'; 4 import 'package:flutter/services.dart';
5 +import 'package:one_poem/generated/l10n.dart';
5 import 'package:one_poem/login/widgets/my_text_field.dart'; 6 import 'package:one_poem/login/widgets/my_text_field.dart';
6 import 'package:one_poem/res/constant.dart'; 7 import 'package:one_poem/res/constant.dart';
7 import 'package:one_poem/res/resources.dart'; 8 import 'package:one_poem/res/resources.dart';
...@@ -15,8 +16,6 @@ import 'package:one_poem/widgets/my_scroll_view.dart'; ...@@ -15,8 +16,6 @@ import 'package:one_poem/widgets/my_scroll_view.dart';
15 16
16 import '../login_router.dart'; 17 import '../login_router.dart';
17 18
18 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
19 -
20 /// design/1注册登录/index.html 19 /// design/1注册登录/index.html
21 class LoginPage extends StatefulWidget { 20 class LoginPage extends StatefulWidget {
22 21
...@@ -84,7 +83,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag ...@@ -84,7 +83,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
84 return Scaffold( 83 return Scaffold(
85 appBar: MyAppBar( 84 appBar: MyAppBar(
86 isBack: false, 85 isBack: false,
87 - actionName: OnePoemLocalizations.of(context).verificationCodeLogin, 86 + actionName:S.current.verificationCodeLogin,
88 onPressed: () { 87 onPressed: () {
89 NavigatorUtils.push(context, LoginRouter.smsLoginPage); 88 NavigatorUtils.push(context, LoginRouter.smsLoginPage);
90 }, 89 },
...@@ -99,7 +98,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag ...@@ -99,7 +98,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
99 98
100 List<Widget> get _buildBody => <Widget>[ 99 List<Widget> get _buildBody => <Widget>[
101 Text( 100 Text(
102 - OnePoemLocalizations.of(context).passwordLogin, 101 + S.of(context).passwordLogin,
103 style: TextStyles.textBold26, 102 style: TextStyles.textBold26,
104 ), 103 ),
105 Gaps.vGap16, 104 Gaps.vGap16,
...@@ -109,7 +108,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag ...@@ -109,7 +108,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
109 controller: _nameController, 108 controller: _nameController,
110 maxLength: 11, 109 maxLength: 11,
111 keyboardType: TextInputType.phone, 110 keyboardType: TextInputType.phone,
112 - hintText: OnePoemLocalizations.of(context).inputUsernameHint, 111 + hintText: S.of(context).inputUsernameHint,
113 ), 112 ),
114 Gaps.vGap8, 113 Gaps.vGap8,
115 MyTextField( 114 MyTextField(
...@@ -119,20 +118,20 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag ...@@ -119,20 +118,20 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
119 isInputPwd: true, 118 isInputPwd: true,
120 controller: _passwordController, 119 controller: _passwordController,
121 keyboardType: TextInputType.visiblePassword, 120 keyboardType: TextInputType.visiblePassword,
122 - hintText: OnePoemLocalizations.of(context).inputPasswordHint, 121 + hintText: S.of(context).inputPasswordHint,
123 ), 122 ),
124 Gaps.vGap24, 123 Gaps.vGap24,
125 MyButton( 124 MyButton(
126 key: const Key('login'), 125 key: const Key('login'),
127 onPressed: _clickable ? _login : null, 126 onPressed: _clickable ? _login : null,
128 - text: OnePoemLocalizations.of(context).login, 127 + text: S.of(context).login,
129 ), 128 ),
130 Container( 129 Container(
131 height: 40.0, 130 height: 40.0,
132 alignment: Alignment.centerRight, 131 alignment: Alignment.centerRight,
133 child: GestureDetector( 132 child: GestureDetector(
134 child: Text( 133 child: Text(
135 - OnePoemLocalizations.of(context).forgotPasswordLink, 134 + S.of(context).forgotPasswordLink,
136 key: const Key('forgotPassword'), 135 key: const Key('forgotPassword'),
137 style: Theme.of(context).textTheme.subtitle2, 136 style: Theme.of(context).textTheme.subtitle2,
138 ), 137 ),
...@@ -144,7 +143,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag ...@@ -144,7 +143,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
144 alignment: Alignment.center, 143 alignment: Alignment.center,
145 child: GestureDetector( 144 child: GestureDetector(
146 child: Text( 145 child: Text(
147 - OnePoemLocalizations.of(context).noAccountRegisterLink, 146 + S.of(context).noAccountRegisterLink,
148 key: const Key('noAccountRegister'), 147 key: const Key('noAccountRegister'),
149 style: TextStyle( 148 style: TextStyle(
150 color: Theme.of(context).primaryColor 149 color: Theme.of(context).primaryColor
......
1 import 'package:flutter/foundation.dart'; 1 import 'package:flutter/foundation.dart';
2 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
3 import 'package:flutter/services.dart'; 3 import 'package:flutter/services.dart';
4 +import 'package:one_poem/generated/l10n.dart';
4 import 'package:one_poem/login/widgets/my_text_field.dart'; 5 import 'package:one_poem/login/widgets/my_text_field.dart';
5 import 'package:one_poem/res/resources.dart'; 6 import 'package:one_poem/res/resources.dart';
6 import 'package:one_poem/res/styles.dart'; 7 import 'package:one_poem/res/styles.dart';
...@@ -11,8 +12,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; ...@@ -11,8 +12,6 @@ import 'package:one_poem/widgets/my_app_bar.dart';
11 import 'package:one_poem/widgets/my_button.dart'; 12 import 'package:one_poem/widgets/my_button.dart';
12 import 'package:one_poem/widgets/my_scroll_view.dart'; 13 import 'package:one_poem/widgets/my_scroll_view.dart';
13 14
14 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
15 -
16 /// design/1注册登录/index.html#artboard11 15 /// design/1注册登录/index.html#artboard11
17 class RegisterPage extends StatefulWidget { 16 class RegisterPage extends StatefulWidget {
18 17
...@@ -74,7 +73,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re ...@@ -74,7 +73,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
74 Widget build(BuildContext context) { 73 Widget build(BuildContext context) {
75 return Scaffold( 74 return Scaffold(
76 appBar: MyAppBar( 75 appBar: MyAppBar(
77 - title: OnePoemLocalizations.of(context).register, 76 + title: S.of(context).register,
78 ), 77 ),
79 body: MyScrollView( 78 body: MyScrollView(
80 keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), 79 keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]),
...@@ -88,7 +87,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re ...@@ -88,7 +87,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
88 List<Widget> _buildBody() { 87 List<Widget> _buildBody() {
89 return <Widget>[ 88 return <Widget>[
90 Text( 89 Text(
91 - OnePoemLocalizations.of(context).openYourAccount, 90 + S.of(context).openYourAccount,
92 style: TextStyles.textBold26, 91 style: TextStyles.textBold26,
93 ), 92 ),
94 Gaps.vGap16, 93 Gaps.vGap16,
...@@ -98,7 +97,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re ...@@ -98,7 +97,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
98 controller: _nameController, 97 controller: _nameController,
99 maxLength: 11, 98 maxLength: 11,
100 keyboardType: TextInputType.phone, 99 keyboardType: TextInputType.phone,
101 - hintText: OnePoemLocalizations.of(context).inputPhoneHint, 100 + hintText: S.of(context).inputPhoneHint,
102 ), 101 ),
103 Gaps.vGap8, 102 Gaps.vGap8,
104 MyTextField( 103 MyTextField(
...@@ -108,16 +107,16 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re ...@@ -108,16 +107,16 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
108 keyboardType: TextInputType.number, 107 keyboardType: TextInputType.number,
109 getVCode: () async { 108 getVCode: () async {
110 if (_nameController.text.length == 11) { 109 if (_nameController.text.length == 11) {
111 - Toast.show(OnePoemLocalizations.of(context).verificationButton); 110 + Toast.show(S.of(context).verificationButton);
112 /// 一般可以在这里发送真正的请求,请求成功返回true 111 /// 一般可以在这里发送真正的请求,请求成功返回true
113 return true; 112 return true;
114 } else { 113 } else {
115 - Toast.show(OnePoemLocalizations.of(context).inputPhoneInvalid); 114 + Toast.show(S.of(context).inputPhoneInvalid);
116 return false; 115 return false;
117 } 116 }
118 }, 117 },
119 maxLength: 6, 118 maxLength: 6,
120 - hintText: OnePoemLocalizations.of(context).inputVerificationCodeHint, 119 + hintText: S.of(context).inputVerificationCodeHint,
121 ), 120 ),
122 Gaps.vGap8, 121 Gaps.vGap8,
123 MyTextField( 122 MyTextField(
...@@ -127,13 +126,13 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re ...@@ -127,13 +126,13 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
127 isInputPwd: true, 126 isInputPwd: true,
128 controller: _passwordController, 127 controller: _passwordController,
129 keyboardType: TextInputType.visiblePassword, 128 keyboardType: TextInputType.visiblePassword,
130 - hintText: OnePoemLocalizations.of(context).inputPasswordHint, 129 + hintText: S.of(context).inputPasswordHint,
131 ), 130 ),
132 Gaps.vGap24, 131 Gaps.vGap24,
133 MyButton( 132 MyButton(
134 key: const Key('register'), 133 key: const Key('register'),
135 onPressed: _clickable ? _register : null, 134 onPressed: _clickable ? _register : null,
136 - text: OnePoemLocalizations.of(context).register, 135 + text: S.of(context).register,
137 ) 136 )
138 ]; 137 ];
139 } 138 }
......
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter/services.dart'; 2 import 'package:flutter/services.dart';
3 +import 'package:one_poem/generated/l10n.dart';
3 import 'package:one_poem/login/widgets/my_text_field.dart'; 4 import 'package:one_poem/login/widgets/my_text_field.dart';
4 import 'package:one_poem/res/resources.dart'; 5 import 'package:one_poem/res/resources.dart';
5 import 'package:one_poem/util/change_notifier_manage.dart'; 6 import 'package:one_poem/util/change_notifier_manage.dart';
...@@ -9,7 +10,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; ...@@ -9,7 +10,6 @@ import 'package:one_poem/widgets/my_app_bar.dart';
9 import 'package:one_poem/widgets/my_button.dart'; 10 import 'package:one_poem/widgets/my_button.dart';
10 import 'package:one_poem/widgets/my_scroll_view.dart'; 11 import 'package:one_poem/widgets/my_scroll_view.dart';
11 12
12 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
13 /// design/1注册登录/index.html#artboard9 13 /// design/1注册登录/index.html#artboard9
14 class ResetPasswordPage extends StatefulWidget { 14 class ResetPasswordPage extends StatefulWidget {
15 15
...@@ -64,14 +64,14 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi ...@@ -64,14 +64,14 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
64 } 64 }
65 65
66 void _reset() { 66 void _reset() {
67 - Toast.show(OnePoemLocalizations.of(context).confirm); 67 + Toast.show(S.of(context).confirm);
68 } 68 }
69 69
70 @override 70 @override
71 Widget build(BuildContext context) { 71 Widget build(BuildContext context) {
72 return Scaffold( 72 return Scaffold(
73 appBar: MyAppBar( 73 appBar: MyAppBar(
74 - title: OnePoemLocalizations.of(context).forgotPasswordLink, 74 + title: S.of(context).forgotPasswordLink,
75 ), 75 ),
76 body: MyScrollView( 76 body: MyScrollView(
77 keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), 77 keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]),
...@@ -85,7 +85,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi ...@@ -85,7 +85,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
85 List<Widget> _buildBody() { 85 List<Widget> _buildBody() {
86 return <Widget>[ 86 return <Widget>[
87 Text( 87 Text(
88 - OnePoemLocalizations.of(context).resetLoginPassword, 88 + S.of(context).resetLoginPassword,
89 style: TextStyles.textBold26, 89 style: TextStyles.textBold26,
90 ), 90 ),
91 Gaps.vGap16, 91 Gaps.vGap16,
...@@ -94,7 +94,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi ...@@ -94,7 +94,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
94 controller: _nameController, 94 controller: _nameController,
95 maxLength: 11, 95 maxLength: 11,
96 keyboardType: TextInputType.phone, 96 keyboardType: TextInputType.phone,
97 - hintText: OnePoemLocalizations.of(context).inputPhoneHint, 97 + hintText: S.of(context).inputPhoneHint,
98 ), 98 ),
99 Gaps.vGap8, 99 Gaps.vGap8,
100 MyTextField( 100 MyTextField(
...@@ -105,7 +105,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi ...@@ -105,7 +105,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
105 return Future<bool>.value(true); 105 return Future<bool>.value(true);
106 }, 106 },
107 maxLength: 6, 107 maxLength: 6,
108 - hintText: OnePoemLocalizations.of(context).inputVerificationCodeHint, 108 + hintText: S.of(context).inputVerificationCodeHint,
109 ), 109 ),
110 Gaps.vGap8, 110 Gaps.vGap8,
111 MyTextField( 111 MyTextField(
...@@ -113,12 +113,12 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi ...@@ -113,12 +113,12 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
113 isInputPwd: true, 113 isInputPwd: true,
114 controller: _passwordController, 114 controller: _passwordController,
115 keyboardType: TextInputType.visiblePassword, 115 keyboardType: TextInputType.visiblePassword,
116 - hintText: OnePoemLocalizations.of(context).inputPasswordHint, 116 + hintText: S.of(context).inputPasswordHint,
117 ), 117 ),
118 Gaps.vGap24, 118 Gaps.vGap24,
119 MyButton( 119 MyButton(
120 onPressed: _clickable ? _reset : null, 120 onPressed: _clickable ? _reset : null,
121 - text: OnePoemLocalizations.of(context).confirm, 121 + text: S.of(context).confirm,
122 ) 122 )
123 ]; 123 ];
124 } 124 }
......
...@@ -2,6 +2,7 @@ import 'dart:ui'; ...@@ -2,6 +2,7 @@ import 'dart:ui';
2 2
3 import 'package:flutter/gestures.dart'; 3 import 'package:flutter/gestures.dart';
4 import 'package:flutter/material.dart'; 4 import 'package:flutter/material.dart';
5 +import 'package:one_poem/generated/l10n.dart';
5 import 'package:one_poem/login/widgets/my_text_field.dart'; 6 import 'package:one_poem/login/widgets/my_text_field.dart';
6 import 'package:one_poem/res/resources.dart'; 7 import 'package:one_poem/res/resources.dart';
7 import 'package:one_poem/routers/fluro_navigator.dart'; 8 import 'package:one_poem/routers/fluro_navigator.dart';
...@@ -13,7 +14,6 @@ import 'package:one_poem/widgets/my_button.dart'; ...@@ -13,7 +14,6 @@ import 'package:one_poem/widgets/my_button.dart';
13 import 'package:one_poem/widgets/my_scroll_view.dart'; 14 import 'package:one_poem/widgets/my_scroll_view.dart';
14 15
15 import '../login_router.dart'; 16 import '../login_router.dart';
16 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
17 /// design/1注册登录/index.html#artboard4 17 /// design/1注册登录/index.html#artboard4
18 class SMSLoginPage extends StatefulWidget { 18 class SMSLoginPage extends StatefulWidget {
19 const SMSLoginPage({Key? key}) : super(key: key); 19 const SMSLoginPage({Key? key}) : super(key: key);
...@@ -77,7 +77,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM ...@@ -77,7 +77,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
77 List<Widget> _buildBody() { 77 List<Widget> _buildBody() {
78 return <Widget>[ 78 return <Widget>[
79 Text( 79 Text(
80 - OnePoemLocalizations.of(context).verificationCodeLogin, 80 + S.of(context).verificationCodeLogin,
81 style: TextStyles.textBold26, 81 style: TextStyles.textBold26,
82 ), 82 ),
83 Gaps.vGap16, 83 Gaps.vGap16,
...@@ -86,7 +86,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM ...@@ -86,7 +86,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
86 controller: _phoneController, 86 controller: _phoneController,
87 maxLength: 11, 87 maxLength: 11,
88 keyboardType: TextInputType.phone, 88 keyboardType: TextInputType.phone,
89 - hintText: OnePoemLocalizations.of(context).inputPhoneHint, 89 + hintText: S.of(context).inputPhoneHint,
90 ), 90 ),
91 Gaps.vGap8, 91 Gaps.vGap8,
92 MyTextField( 92 MyTextField(
...@@ -94,9 +94,9 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM ...@@ -94,9 +94,9 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
94 controller: _vCodeController, 94 controller: _vCodeController,
95 maxLength: 6, 95 maxLength: 6,
96 keyboardType: TextInputType.number, 96 keyboardType: TextInputType.number,
97 - hintText: OnePoemLocalizations.of(context).inputVerificationCodeHint, 97 + hintText: S.of(context).inputVerificationCodeHint,
98 getVCode: () { 98 getVCode: () {
99 - Toast.show(OnePoemLocalizations.of(context).getVerificationCode); 99 + Toast.show(S.of(context).getVerificationCode);
100 return Future<bool>.value(true); 100 return Future<bool>.value(true);
101 }, 101 },
102 ), 102 ),
...@@ -105,11 +105,11 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM ...@@ -105,11 +105,11 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
105 alignment: Alignment.centerLeft, 105 alignment: Alignment.centerLeft,
106 child: RichText( 106 child: RichText(
107 text: TextSpan( 107 text: TextSpan(
108 - text: OnePoemLocalizations.of(context).registeredTips, 108 + text: S.of(context).registeredTips,
109 style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), 109 style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14),
110 children: <TextSpan>[ 110 children: <TextSpan>[
111 TextSpan( 111 TextSpan(
112 - text: OnePoemLocalizations.of(context).register, 112 + text: S.of(context).register,
113 style: TextStyle( 113 style: TextStyle(
114 color: Theme.of(context).errorColor, 114 color: Theme.of(context).errorColor,
115 ), 115 ),
...@@ -126,14 +126,14 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM ...@@ -126,14 +126,14 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
126 Gaps.vGap24, 126 Gaps.vGap24,
127 MyButton( 127 MyButton(
128 onPressed: _clickable ? _login : null, 128 onPressed: _clickable ? _login : null,
129 - text: OnePoemLocalizations.of(context).login, 129 + text: S.of(context).login,
130 ), 130 ),
131 Container( 131 Container(
132 height: 40.0, 132 height: 40.0,
133 alignment: Alignment.centerRight, 133 alignment: Alignment.centerRight,
134 child: GestureDetector( 134 child: GestureDetector(
135 child: Text( 135 child: Text(
136 - OnePoemLocalizations.of(context).forgotPasswordLink, 136 + S.of(context).forgotPasswordLink,
137 style: Theme.of(context).textTheme.subtitle2, 137 style: Theme.of(context).textTheme.subtitle2,
138 ), 138 ),
139 onTap: () => NavigatorUtils.push(context, LoginRouter.resetPasswordPage), 139 onTap: () => NavigatorUtils.push(context, LoginRouter.resetPasswordPage),
......
...@@ -3,11 +3,11 @@ import 'dart:async'; ...@@ -3,11 +3,11 @@ import 'dart:async';
3 import 'package:flutter/foundation.dart'; 3 import 'package:flutter/foundation.dart';
4 import 'package:flutter/material.dart'; 4 import 'package:flutter/material.dart';
5 import 'package:flutter/services.dart'; 5 import 'package:flutter/services.dart';
6 +import 'package:one_poem/generated/l10n.dart';
6 import 'package:one_poem/res/resources.dart'; 7 import 'package:one_poem/res/resources.dart';
7 import 'package:one_poem/util/device_utils.dart'; 8 import 'package:one_poem/util/device_utils.dart';
8 import 'package:one_poem/widgets/load_image.dart'; 9 import 'package:one_poem/widgets/load_image.dart';
9 import 'package:one_poem/widgets/my_button.dart'; 10 import 'package:one_poem/widgets/my_button.dart';
10 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
11 /// 登录模块的输入框封装 11 /// 登录模块的输入框封装
12 class MyTextField extends StatefulWidget { 12 class MyTextField extends StatefulWidget {
13 13
...@@ -179,7 +179,7 @@ class _MyTextFieldState extends State<MyTextField> { ...@@ -179,7 +179,7 @@ class _MyTextFieldState extends State<MyTextField> {
179 key: const Key('getVerificationCode'), 179 key: const Key('getVerificationCode'),
180 onPressed: _clickable ? _getVCode : null, 180 onPressed: _clickable ? _getVCode : null,
181 fontSize: Dimens.font_sp12, 181 fontSize: Dimens.font_sp12,
182 - text: _clickable ? OnePoemLocalizations.of(context).getVerificationCode : '($_currentSecond s)', 182 + text: _clickable ? S.of(context).getVerificationCode : '($_currentSecond s)',
183 textColor: themeData.primaryColor, 183 textColor: themeData.primaryColor,
184 disabledTextColor: isDark ? Colours.dark_text : Colors.white, 184 disabledTextColor: isDark ? Colours.dark_text : Colors.white,
185 backgroundColor: Colors.transparent, 185 backgroundColor: Colors.transparent,
......
...@@ -3,12 +3,11 @@ import 'package:flustars/flustars.dart'; ...@@ -3,12 +3,11 @@ import 'package:flustars/flustars.dart';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter/services.dart'; 4 import 'package:flutter/services.dart';
5 import 'package:oktoast/oktoast.dart'; 5 import 'package:oktoast/oktoast.dart';
6 +import 'package:one_poem/generated/l10n.dart';
6 import 'package:provider/provider.dart'; 7 import 'package:provider/provider.dart';
7 import 'package:quick_actions/quick_actions.dart'; 8 import 'package:quick_actions/quick_actions.dart';
8 import 'package:url_strategy/url_strategy.dart'; 9 import 'package:url_strategy/url_strategy.dart';
9 10
10 -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart';
11 -
12 import 'home/splash_page.dart'; 11 import 'home/splash_page.dart';
13 import 'net/dio_utils.dart'; 12 import 'net/dio_utils.dart';
14 import 'net/intercept.dart'; 13 import 'net/intercept.dart';
...@@ -154,8 +153,8 @@ class MyApp extends StatelessWidget { ...@@ -154,8 +153,8 @@ class MyApp extends StatelessWidget {
154 themeMode: provider.getThemeMode(), 153 themeMode: provider.getThemeMode(),
155 home: home ?? const SplashPage(), 154 home: home ?? const SplashPage(),
156 onGenerateRoute: Routes.router.generator, 155 onGenerateRoute: Routes.router.generator,
157 - localizationsDelegates: OnePoemLocalizations.localizationsDelegates, 156 + localizationsDelegates: const [S.delegate],
158 - supportedLocales: OnePoemLocalizations.supportedLocales, 157 + supportedLocales: S.delegate.supportedLocales,
159 locale: localeProvider.locale, 158 locale: localeProvider.locale,
160 navigatorKey: navigatorKey, 159 navigatorKey: navigatorKey,
161 builder: (BuildContext context, Widget? child) { 160 builder: (BuildContext context, Widget? child) {
......
This diff is collapsed. Click to expand it.
...@@ -70,7 +70,7 @@ dependencies: ...@@ -70,7 +70,7 @@ dependencies:
70 # 状态管理 https://github.com/rrousselGit/provider 70 # 状态管理 https://github.com/rrousselGit/provider
71 provider: ^6.0.1 71 provider: ^6.0.1
72 # 扫码 https://github.com/juliuscanute/qr_code_scanner 72 # 扫码 https://github.com/juliuscanute/qr_code_scanner
73 - qr_code_scanner: 0.6.1 73 + qr_code_scanner: 0.7.0
74 # App Shortcuts https://github.com/flutter/plugins/tree/master/packages/quick_actions 74 # App Shortcuts https://github.com/flutter/plugins/tree/master/packages/quick_actions
75 quick_actions: ^0.6.0+8 75 quick_actions: ^0.6.0+8
76 # 振动(支持Web) https://github.com/benjamindean/flutter_vibration 76 # 振动(支持Web) https://github.com/benjamindean/flutter_vibration
......