This commit is contained in:
v7lin
2022-07-26 20:21:04 +08:00
parent f71fc9adc9
commit 0edd965bb2
10 changed files with 144 additions and 21 deletions

View File

@ -18,6 +18,7 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State<MyApp> {
String? _initialLink;
StreamSubscription<String>? _linkClickSubs;
@override
@ -27,6 +28,9 @@ class _MyAppState extends State<MyApp> {
if (kDebugMode) {
print('initialLink: $value');
}
setState(() {
_initialLink = value;
});
});
_linkClickSubs = Link.instance.linkClickStream().listen((String event) {
if (kDebugMode) {
@ -48,6 +52,9 @@ class _MyAppState extends State<MyApp> {
appBar: AppBar(
title: Text('Link Kit'),
),
body: Center(
child: Text(_initialLink ?? ''),
),
),
);
}