Skip to content

Commit

Permalink
Switch var to final
Browse files Browse the repository at this point in the history
  • Loading branch information
KristijanMitrik committed Dec 17, 2024
1 parent b79d5ba commit 0dc4967
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/wireguard_dart_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MethodChannelWireguardDart extends WireguardDartPlatform {

@override
Future<KeyPair> generateKeyPair() async {
var result = await methodChannel.invokeMapMethod<String, String>('generateKeyPair') ?? <String, String>{};
final result = await methodChannel.invokeMapMethod<String, String>('generateKeyPair') ?? <String, String>{};
if (!result.containsKey('publicKey') || !result.containsKey('privateKey')) {
throw StateError('Could not generate keypair');
}
Expand All @@ -26,7 +26,7 @@ class MethodChannelWireguardDart extends WireguardDartPlatform {

@override
Future<void> setupTunnel({required String bundleId, required String tunnelName, String? win32ServiceName}) async {
var args = {
final args = {
'bundleId': bundleId,
'tunnelName': tunnelName,
if (win32ServiceName != null) 'win32ServiceName': win32ServiceName,
Expand All @@ -46,7 +46,7 @@ class MethodChannelWireguardDart extends WireguardDartPlatform {

@override
Future<ConnectionStatus> status() async {
var result = await methodChannel.invokeMethod<String>('status');
final result = await methodChannel.invokeMethod<String>('status');
return ConnectionStatus.fromString(result ?? "");
}

Expand All @@ -60,7 +60,7 @@ class MethodChannelWireguardDart extends WireguardDartPlatform {
required String bundleId,
required String tunnelName,
}) async {
var result = await methodChannel.invokeMethod<bool>('checkTunnelConfiguration', {
final result = await methodChannel.invokeMethod<bool>('checkTunnelConfiguration', {
'bundleId': bundleId,
'tunnelName': tunnelName,
});
Expand Down

0 comments on commit 0dc4967

Please sign in to comment.