Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Dec 2, 2024
1 parent 6c80239 commit 3de69a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ import 'package:gsy_flutter_demo/widget/gesture_password/gesture_password_demo_p

import 'package:window_location_href/window_location_href.dart';

void main() => runApp(const MyApp());
void main() {
runApp(const MyApp());
WidgetsBinding.instance.addObserver(ReferrerObserver());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});
Expand Down Expand Up @@ -250,6 +253,18 @@ class MyHomePage extends StatefulWidget {
MyHomePageState createState() => MyHomePageState();
}

class ReferrerObserver with WidgetsBindingObserver {
@override
Future<bool> didPushRouteInformation(
RouteInformation routeInformation) async {
if (kDebugMode) {
print("didPushRouteInformation ${routeInformation.uri}");
}
/// print("didPushRouteInformation ${await Referrer().getReferrer()}");
return false;
}
}

class MyHomePageState extends State<MyHomePage> {
@override
void initState() {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down

0 comments on commit 3de69a3

Please sign in to comment.