readWeight method

  1. @override
Future<Map<String, dynamic>?> readWeight(
  1. int scannerId
)
override

Read weight from scale

scannerId The ID of the scanner Returns a map with 'weight', 'weightMode', 'status', and 'statusText'

Implementation

@override
Future<Map<String, dynamic>?> readWeight(int scannerId) async {
  if (scannerId <= 0) {
    throw ArgumentError('scannerId must be greater than 0');
  }
  final result = await methodChannel.invokeMethod<Map<Object?, Object?>>(
    'readWeight',
    {'scannerId': scannerId},
  );
  if (result == null) return null;
  return Map<String, dynamic>.from(result);
}