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