24 lines
737 B
Dart
24 lines
737 B
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'alive_plugin_platform_interface.dart';
|
|
|
|
/// An implementation of [AlivePluginPlatform] that uses method channels.
|
|
class MethodChannelAlivePlugin extends AlivePluginPlatform {
|
|
/// The method channel used to interact with the native platform.
|
|
@visibleForTesting
|
|
final methodChannel = const MethodChannel('alive_plugin');
|
|
|
|
@override
|
|
Future<String?> getPlatformVersion() async {
|
|
final version =
|
|
await methodChannel.invokeMethod<String>('getPlatformVersion');
|
|
return version;
|
|
}
|
|
|
|
@override
|
|
Future<void> backToDesktopButKeepAlive() async {
|
|
await methodChannel.invokeMethod<String>('backToDesktopButKeepAlive');
|
|
}
|
|
}
|