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.
samples/experimental/federated_plugin/federated_plugin_platform_i.../lib/federated_plugin_platform_i...

31 lines
1.1 KiB

// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:federated_plugin_platform_interface/battery_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
/// Interface which allows all the platform plugins to implement the same
/// functionality.
abstract class FederatedPluginInterface extends PlatformInterface {
FederatedPluginInterface() : super(token: _object);
static FederatedPluginInterface _federatedPluginInterface =
BatteryMethodChannel();
static final Object _object = Object();
/// Provides instance of [BatteryMethodChannel] to invoke platform calls.
static FederatedPluginInterface get instance => _federatedPluginInterface;
static set instance(FederatedPluginInterface instance) {
PlatformInterface.verifyToken(instance, _object);
_federatedPluginInterface = instance;
}
/// Returns the current battery level of device.
Future<int> getBatteryLevel() async {
throw UnimplementedError('getBatteryLevel() has not been implemented.');
}
}