Files
zhiwen/lib/zhiwen_platform_interface.dart
2026-04-13 16:03:09 +08:00

45 lines
1.6 KiB
Dart

import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'dart:async';
import 'zhiwen_method_channel.dart';
abstract class ZhiwenPlatform extends PlatformInterface {
/// Constructs a ZhiwenPlatform.
ZhiwenPlatform() : super(token: _token);
static final Object _token = Object();
static ZhiwenPlatform _instance = MethodChannelZhiwen();
/// The default instance of [ZhiwenPlatform] to use.
///
/// Defaults to [MethodChannelZhiwen].
static ZhiwenPlatform get instance => _instance;
Future<String?> getPlatformVersion();
Future<bool> openDevice(String devicePath, int baudRate);
Future<void> closeDevice();
Future<Map<String, dynamic>> enrollFingerprint(int userId);
Future<Map<String, dynamic>> verifyFingerprint(int userId);
Future<Map<String, dynamic>> deleteAllFingerprint();
Future<Map<String, dynamic>> deleteOneFingerprint(int userId);
Future<Map<String, dynamic>> identifyFingerprint();
Future<Map<String, dynamic>> getUserCount();
/// 获取指纹录入进度事件流
/// 返回包含 step, totalSteps, progress, message 的 Map
Stream<Map<String, dynamic>> get progressStream;
/// Platform-specific implementations should set this with their own
/// platform-specific class that extends [ZhiwenPlatform] when
/// they register themselves.
static set instance(ZhiwenPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
// Future<String?> getPlatformVersion() {
// throw UnimplementedError('platformVersion() has not been implemented.');
// }
}