mirror of
https://github.com/RxReader/link_kit.git
synced 2025-08-14 10:46:15 +08:00
format
This commit is contained in:
@ -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 ?? ''),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user