mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
[platform_channels] Migrate to sound null safety (#803)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:platform_channels/src/counter_method_channel.dart';
|
||||
|
||||
/// The widget demonstrates how to use [MethodChannel] to invoke platform methods.
|
||||
@@ -45,7 +46,7 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
(error as PlatformException).message!,
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -63,7 +64,7 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
(error as PlatformException).message!,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user