File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,16 @@ class MyApp extends StatefulWidget {
1111}
1212
1313class _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 });
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments