Skip to content

Commit 204d89b

Browse files
committed
hint
1 parent b91f23f commit 204d89b

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

lib/common/utils/common_utils.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,12 @@ class CommonUtils {
381381
}
382382

383383
static launchOutURL(String? url, BuildContext context) async {
384+
var gl = GSYLocalizations.i18n(context);
384385
if (url != null && await canLaunchUrl(Uri.parse(url))) {
385386
await launchUrl(Uri.parse(url));
386387
} else {
387388
Fluttertoast.showToast(
388-
msg: "${GSYLocalizations.i18n(context)!.option_web_launcher_error}: ${url ?? ""}");
389+
msg: "${gl!.option_web_launcher_error}: ${url ?? ""}");
389390
}
390391
}
391392

lib/model/Branch.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/page/debug/debug_label.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ class DebugLabel {
2020
return false;
2121
}
2222
hadShow = true;
23+
var gl = GSYLocalizations.of(context);
24+
var overlayState = Overlay.of(context);
2325
var (version, platform) = await _getDeviceInfo();
2426
PackageInfo packInfo = await PackageInfo.fromPlatform();
25-
var language = GSYLocalizations.of(context)!.locale.languageCode;
27+
var language = gl!.locale.languageCode;
2628
if (_overlayEntry != null) {
2729
_overlayEntry!.remove();
2830
_overlayEntry = null;
2931
}
30-
var overlayState = Overlay.of(context);
3132
_overlayEntry = OverlayEntry(builder: (context) {
3233
return GlobalLabel(
3334
version: packInfo.version,

lib/page/login/login_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,14 @@ mixin LoginBLoC on State<LoginPage> {
199199
}
200200

201201
oauthLogin() async {
202+
var st = StoreProvider.of<GSYState>(context);
202203
String? code = await NavigatorUtils.goLoginWebView(context,
203204
Address.getOAuthUrl(), GSYLocalizations.i18n(context)!.oauth_text);
204205

205206
if (code != null && code.isNotEmpty) {
206207
///通过 redux 去执行登陆流程
207-
StoreProvider.of<GSYState>(context).dispatch(OAuthAction(context, code));
208+
// ignore: use_build_context_synchronously
209+
st.dispatch(OAuthAction(context, code));
208210
}
209211
}
210212
}

lib/page/release/release_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ class _ReleasePageState extends State<ReleasePage>
6363
///打开外部url
6464
_launchURL() async {
6565
String url = _getUrl();
66+
var gl = GSYLocalizations.i18n(context);
6667
if (await canLaunchUrl(Uri.parse(url))) {
6768
await launchUrl(Uri.parse(url));
6869
} else {
6970
Fluttertoast.showToast(
70-
msg: "${GSYLocalizations.i18n(context)!.option_web_launcher_error}: $url");
71+
msg: "${gl!.option_web_launcher_error}: $url");
7172
}
7273
}
7374

lib/page/user/person_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: annotate_overrides
2+
13
import 'dart:async';
24

35
import 'package:auto_size_text/auto_size_text.dart';

lib/redux/login_redux.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ignore_for_file: implicit_call_tearoffs
1+
// ignore_for_file: implicit_call_tearoffs, use_build_context_synchronously
22

33
import 'package:flutter/material.dart';
44
import 'package:gsy_github_app_flutter/db/sql_manager.dart';
@@ -76,9 +76,10 @@ Stream<dynamic> loginEpic(Stream<dynamic> actions, EpicStore<GSYState> store) {
7676
Stream<dynamic> loginIn(
7777
LoginAction action, EpicStore<GSYState> store) async* {
7878
CommonUtils.showLoadingDialog(action.context);
79+
var nv = Navigator.of(action.context);
7980
var res = await UserDao.login(
8081
action.username!.trim(), action.password!.trim(), store);
81-
Navigator.pop(action.context);
82+
nv.pop(action);
8283
yield LoginSuccessAction(action.context, (res != null && res.result));
8384
}
8485
return actions

0 commit comments

Comments
 (0)