Enable null safety by default in templates (#78619)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ class {{pluginDartClass}}Web {
|
||||
switch (call.method) {
|
||||
case 'getPlatformVersion':
|
||||
return getPlatformVersion();
|
||||
break;
|
||||
default:
|
||||
throw PlatformException(
|
||||
code: 'Unimplemented',
|
||||
|
||||
@@ -4,7 +4,7 @@ version: 0.0.1
|
||||
homepage:
|
||||
|
||||
environment:
|
||||
sdk: ">=2.7.0 <3.0.0"
|
||||
sdk: {{dartSdkVersionBounds}}
|
||||
flutter: ">=1.20.0"
|
||||
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user