Skip to content

Commit 6a4c435

Browse files
committed
Updated
1 parent 8de544d commit 6a4c435

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

example/lib/main.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ class MyApp extends StatefulWidget {
1111
}
1212

1313
class _MyAppState extends State<MyApp> {
14-
String action = '';
14+
String action = 'No Action';
1515

1616
@override
1717
void initState() {
1818
super.initState();
1919
final FlutterShortcuts flutterShortcuts = FlutterShortcuts();
20-
flutterShortcuts.initialize((String action) {
20+
flutterShortcuts.initialize((String incomingAction) {
2121
setState(() {
22-
if (action != null) {
23-
action = action;
22+
if (incomingAction != null) {
23+
action = incomingAction;
2424
}
2525
});
2626
});
@@ -48,7 +48,7 @@ class _MyAppState extends State<MyApp> {
4848
),
4949
]).then((value) {
5050
setState(() {
51-
if (action == '') {
51+
if (action == 'No Action') {
5252
action = 'Flutter Shortcuts Ready';
5353
}
5454
});

lib/src/method_call/flutter_shortcuts_method_call_handler.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ class FlutterShortcutsMethodCallHandler extends FlutterShortcutsPlatform {
99
MethodChannel get channel => _channel;
1010

1111
@override
12-
Future<void> initialize(FlutterShortcutAction action) async {
12+
Future<void> initialize(FlutterShortcutAction actionHandler) async {
1313
// super.initialize(action);
1414
channel.setMethodCallHandler((MethodCall call) async {
1515
assert(call.method == 'launch');
16-
action(call.arguments);
16+
actionHandler(call.arguments);
1717
});
18-
final String actions =
19-
await channel.invokeMethod<String>('getLaunchAction');
18+
final String action = await channel.invokeMethod<String>('getLaunchAction');
2019
if (action != null) {
21-
action(actions);
20+
actionHandler(action);
2221
}
2322
}
2423

0 commit comments

Comments
 (0)