getConnection method

  1. @override
Future<Map<String, Object?>> getConnection()
override

Returns the current connection, in the same format as the connectionChanged event.

Implementation

@override
Future<Map<String, Object?>> getConnection() async {
  final result = await methodChannel.invokeMapMethod<String, Object?>(
    'getConnection',
  );
  return result ?? const {'connected': false};
}