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.

34 lines
993 B

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'ota_platform_interface.dart';
/// An implementation of [OtaPlatform] that uses method channels.
class MethodChannelOta extends OtaPlatform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('ota');
@override
Future<String?> getPlatformVersion() async {
final version = await methodChannel.invokeMethod<String>(
'getPlatformVersion',
);
return version;
}
Future<String?> searchDevices() async {
final version = await methodChannel.invokeMethod<String>('searchDevices');
return version;
}
Future<String?> connectDevice() async {
final version = await methodChannel.invokeMethod<String>('connectDevice');
return version;
}
Future<String?> startUpgrade() async {
final version = await methodChannel.invokeMethod<String>('startUpgrade');
return version;
}
}