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

@@ -25,7 +25,7 @@ class PlatformView extends StatelessWidget {
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key key, this.title}) : super(key: key);
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@@ -46,10 +46,10 @@ class _MyHomePageState extends State<MyHomePage> {
}
Future<void> _launchPlatformCount() async {
final int platformCounter =
final int? platformCounter =
await _methodChannel.invokeMethod('switchView', _counter);
setState(() {
_counter = platformCounter;
_counter = platformCounter!;
});
}

View File

@@ -1,7 +1,7 @@
name: platform_view
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter: