mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 15:28:44 +00:00
[platform_channels] Migrate to sound null safety (#803)
This commit is contained in:
@@ -14,16 +14,16 @@ class Counter {
|
||||
static MethodChannel methodChannel = const MethodChannel('methodChannelDemo');
|
||||
|
||||
/// This method is responsible to increment and return the value of count.
|
||||
static Future<int> increment({int counterValue}) async {
|
||||
static Future<int> increment({required int counterValue}) async {
|
||||
final result = await methodChannel
|
||||
.invokeMethod<int>('increment', {'count': counterValue});
|
||||
return result;
|
||||
return result!;
|
||||
}
|
||||
|
||||
/// This method is responsible to decrement and return the value of count.
|
||||
static Future<int> decrement({int counterValue}) async {
|
||||
static Future<int> decrement({required int counterValue}) async {
|
||||
final result = await methodChannel
|
||||
.invokeMethod<int>('decrement', {'count': counterValue});
|
||||
return result;
|
||||
return result!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user