You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.2 KiB
80 lines
2.2 KiB
import 'native_plugin_platform_interface.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
class NativePlugin {
|
|
Future<String?> getPlatformVersion() {
|
|
return NativePluginPlatform.instance.getPlatformVersion();
|
|
}
|
|
|
|
Future<int> createPipContentView() {
|
|
return NativePluginPlatform.instance.createPipContentView();
|
|
}
|
|
|
|
Future<void> updatePipContentView(Map data) {
|
|
return NativePluginPlatform.instance.updatePipContentView(data);
|
|
}
|
|
|
|
Future<void> disposePipContentView(int viewId) {
|
|
return NativePluginPlatform.instance.disposePipContentView(viewId);
|
|
}
|
|
|
|
Future<void> showRecordingFloatingBar({
|
|
required String duration,
|
|
String? recordingType,
|
|
bool isPaused = false,
|
|
}) {
|
|
return NativePluginPlatform.instance.showRecordingFloatingBar(
|
|
duration: duration,
|
|
recordingType: recordingType,
|
|
isPaused: isPaused,
|
|
);
|
|
}
|
|
|
|
Future<void> updateRecordingFloatingBar({
|
|
required String duration,
|
|
String? recordingType,
|
|
bool isPaused = false,
|
|
}) {
|
|
return NativePluginPlatform.instance.updateRecordingFloatingBar(
|
|
duration: duration,
|
|
recordingType: recordingType,
|
|
isPaused: isPaused,
|
|
);
|
|
}
|
|
|
|
Future<void> hideRecordingFloatingBar() {
|
|
return NativePluginPlatform.instance.hideRecordingFloatingBar();
|
|
}
|
|
|
|
Stream<String> get recordingFloatingActionStream =>
|
|
NativePluginPlatform.instance.recordingFloatingActionStream;
|
|
}
|
|
|
|
class TranslationFloatingWindowApi {
|
|
static const MethodChannel channel = MethodChannel('floating_window');
|
|
|
|
Future<bool> enable() async {
|
|
final result = await channel.invokeMethod<bool>('enableFloatingWindow');
|
|
return result ?? false;
|
|
}
|
|
|
|
Future<void> disable() {
|
|
return channel.invokeMethod<void>('disableFloatingWindow');
|
|
}
|
|
|
|
Future<void> show() {
|
|
return channel.invokeMethod<void>('showFloatingWindow');
|
|
}
|
|
|
|
Future<void> hide() {
|
|
return channel.invokeMethod<void>('hideFloatingWindow');
|
|
}
|
|
|
|
Future<void> updateContent(Map<String, dynamic> data) {
|
|
return channel.invokeMethod<void>('updateContent', data);
|
|
}
|
|
|
|
Future<void> setPosition({required double x, required double y}) {
|
|
return channel.invokeMethod<void>('setPosition', {'x': x, 'y': y});
|
|
}
|
|
}
|
|
|