Migrate remaining examples to null-safety (#74857)

This commit is contained in:
Michael Goderbauer
2021-01-27 17:26:23 -08:00
committed by GitHub
parent c505ee79de
commit 06f051b2d5
14 changed files with 37 additions and 32 deletions

View File

@@ -11,7 +11,6 @@ void main() {
}
class FlutterView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@@ -33,8 +32,8 @@ class _MyHomePageState extends State<MyHomePage> {
static const String _channel = 'increment';
static const String _pong = 'pong';
static const String _emptyMessage = '';
static const BasicMessageChannel<String> platform =
BasicMessageChannel<String>(_channel, StringCodec());
static const BasicMessageChannel<String?> platform =
BasicMessageChannel<String?>(_channel, StringCodec());
int _counter = 0;
@@ -44,7 +43,7 @@ class _MyHomePageState extends State<MyHomePage> {
platform.setMessageHandler(_handlePlatformIncrement);
}
Future<String> _handlePlatformIncrement(String message) async {
Future<String> _handlePlatformIncrement(String? message) async {
setState(() {
_counter++;
});

View File

@@ -2,7 +2,7 @@ name: flutter_view
description: A new flutter project.
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter: