getPlatformVersion method

  1. @override
Future<String?> getPlatformVersion()
override

Returns the current platform version.

This method is used to test that method channels are working correctly. Each platform implementation should override this method to return the platform version.

@return The platform version as a string (e.g., "Android 12" or "iOS 15.0").

Implementation

@override
Future<String?> getPlatformVersion() async {
  final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
  return version;
}