Enable null safety by default in templates (#78619)

This commit is contained in:
Michael Thomsen
2021-03-30 10:16:05 +02:00
committed by GitHub
parent e93590474d
commit 2cdd51900c
13 changed files with 25 additions and 151 deletions

View File

@@ -13,8 +13,8 @@ class {{pluginDartClass}} {
static const MethodChannel _channel =
const MethodChannel('{{projectName}}');
static Future<String> get platformVersion async {
final String version = await _channel.invokeMethod('getPlatformVersion');
static Future<String?> get platformVersion async {
final String? version = await _channel.invokeMethod('getPlatformVersion');
return version;
}
}

View File

@@ -28,7 +28,6 @@ class {{pluginDartClass}}Web {
switch (call.method) {
case 'getPlatformVersion':
return getPlatformVersion();
break;
default:
throw PlatformException(
code: 'Unimplemented',

View File

@@ -4,7 +4,7 @@ version: 0.0.1
homepage:
environment:
sdk: ">=2.7.0 <3.0.0"
sdk: {{dartSdkVersionBounds}}
flutter: ">=1.20.0"
dependencies: