Skip to content

Commit 6e52089

Browse files
committed
Fix Web
1 parent 4d82435 commit 6e52089

18 files changed

Lines changed: 156 additions & 114 deletions

CHANGELOG-zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#
22

3+
## 1.3.9
4+
* 修复BUG
5+
36
## 1.3.8
47
* 更新android sdk 为 2.14.19
58
* 更新ios sdk 为 2.14.15

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#
22

3+
## 1.3.9
4+
* FIX BUG
5+
36
## 1.3.8
47
* Update the Android SDK to version 2.14.19
58
* Update iOS SDK to 2.14.15

ali_auth.iml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
102102
<excludeFolder url="file://$MODULE_DIR$/.pub" />
103103
<excludeFolder url="file://$MODULE_DIR$/build" />
104+
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
105+
<excludeFolder url="file://$MODULE_DIR$/.pub" />
106+
<excludeFolder url="file://$MODULE_DIR$/build" />
107+
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
108+
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
109+
<excludeFolder url="file://$MODULE_DIR$/example/build" />
104110
</content>
105111
<orderEntry type="sourceFolder" forTests="false" />
106112
<orderEntry type="library" name="Dart SDK" level="project" />

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'com.android.library'
22
group 'com.sean.rao.ali_auth'
3-
version '1.3.8'
3+
version '1.3.9'
44

55
buildscript {
66
repositories {

example/lib/main.dart

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:ui';
21
import 'package:flutter/foundation.dart';
32
import 'package:flutter/material.dart';
43
import 'package:fluttertoast/fluttertoast.dart';
@@ -11,7 +10,7 @@ void main() {
1110
}
1211

1312
class MyApp extends StatefulWidget {
14-
const MyApp({Key? key}) : super(key: key);
13+
const MyApp({super.key});
1514

1615
@override
1716
State<MyApp> createState() => _MyAppState();
@@ -26,7 +25,7 @@ class _MyAppState extends State<MyApp> {
2625

2726
Widget getDefaultRouter() {
2827
//还记得我们上边的routerPage嘛, 这个东西就是我们传进来的字符串,我们可以根据这个字符串来决定加载那个flutter页面
29-
String router = window.defaultRouteName;
28+
String router = PlatformDispatcher.instance.defaultRouteName;
3029
if (kDebugMode) {
3130
print("获取到路由数据--------$router");
3231
}
@@ -44,19 +43,21 @@ class _MyAppState extends State<MyApp> {
4443

4544
@override
4645
Widget build(BuildContext context) {
47-
return WillPopScope(
48-
onWillPop: () {
49-
// 退出APP方法一
50-
Fluttertoast.showToast(
51-
msg: '您确定要退出思预云吗?',
52-
toastLength: Toast.LENGTH_SHORT,
53-
gravity: ToastGravity.CENTER,
54-
timeInSecForIosWeb: 1,
55-
backgroundColor: Colors.red,
56-
textColor: Colors.white,
57-
fontSize: 16.0);
58-
return Future.value(false);
59-
}, // look here!
46+
return PopScope(
47+
canPop: false,
48+
onPopInvokedWithResult: (didPop, result) {
49+
// 退出APP方法二
50+
if (!didPop) {
51+
Fluttertoast.showToast(
52+
msg: '您确定要退出思预云吗?',
53+
toastLength: Toast.LENGTH_SHORT,
54+
gravity: ToastGravity.CENTER,
55+
timeInSecForIosWeb: 1,
56+
backgroundColor: Colors.red,
57+
textColor: Colors.white,
58+
fontSize: 16.0);
59+
}
60+
},// look here!
6061
child: MaterialApp(
6162
home: getDefaultRouter(),
6263
routes: <String, WidgetBuilder>{

example/lib/my_home_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
88
import 'package:fluttertoast/fluttertoast.dart';
99

1010
class MyHomePage extends StatefulWidget {
11-
const MyHomePage({Key? key}) : super(key: key);
11+
const MyHomePage({super.key});
1212

1313
@override
1414
State<StatefulWidget> createState() {
@@ -140,6 +140,8 @@ class MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
140140
break;
141141
case AppLifecycleState.detached: // TODO: Handle this case.
142142
break;
143+
default:
144+
break;
143145
}
144146
}
145147

example/lib/my_home_page_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter/services.dart';
55

66
class MyHomePageWeb extends StatefulWidget {
7-
const MyHomePageWeb({Key? key}) : super(key: key);
7+
const MyHomePageWeb({super.key});
88

99
@override
1010
State<StatefulWidget> createState() {

example/lib/my_router_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:ali_auth_example/my_home_page.dart';
22
import 'package:flutter/material.dart';
33

44
class MyRouterPage extends StatefulWidget {
5-
const MyRouterPage({Key? key}) : super(key: key);
5+
const MyRouterPage({super.key});
66

77
@override
88
State<StatefulWidget> createState() {

example/pubspec.lock

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ packages:
5252
dependency: "direct main"
5353
description:
5454
name: cupertino_icons
55-
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
55+
sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd"
5656
url: "https://pub.flutter-io.cn"
5757
source: hosted
58-
version: "1.0.8"
58+
version: "1.0.9"
5959
fake_async:
6060
dependency: transitive
6161
description:
@@ -95,6 +95,14 @@ packages:
9595
url: "https://pub.flutter-io.cn"
9696
source: hosted
9797
version: "9.0.0"
98+
js:
99+
dependency: transitive
100+
description:
101+
name: js
102+
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
103+
url: "https://pub.flutter-io.cn"
104+
source: hosted
105+
version: "0.7.2"
98106
leak_tracker:
99107
dependency: transitive
100108
description:
@@ -245,5 +253,5 @@ packages:
245253
source: hosted
246254
version: "1.1.1"
247255
sdks:
248-
dart: ">=3.9.0-0 <4.0.0"
256+
dart: ">=3.9.0 <4.0.0"
249257
flutter: ">=3.18.0-18.0.pre.54"

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies:
2828

2929
# The following adds the Cupertino Icons font to your application.
3030
# Use with the CupertinoIcons class for iOS style icons.
31-
cupertino_icons: ^1.0.8
31+
cupertino_icons: ^1.0.9
3232
# 弹窗
3333
fluttertoast: ^9.0.0
3434

0 commit comments

Comments
 (0)