initialize static method
Returns if the given device is supported. This will also be used when calling the different methods
Returns null if the device is not supported
Implementation
static Future<ScanwedgeChannel> initialize() async {
try {
if (isAndroid) {
final supportedResponse = await _methodChannel.invokeMethod<String>('initializeDataWedge');
debugPrint('initializeDataWedge: $supportedResponse');
if (supportedResponse != null) {
final devInfoString = supportedResponse.split('|');
if (devInfoString.length > 5) {
return ScanwedgeChannel._(
supportedDevice: _fetchSupportedDevice(devInfoString[0]),
manufacturer: devInfoString[1],
modelName: devInfoString[2],
productName: devInfoString[3],
osVersion: devInfoString[4],
packageName: devInfoString[5],
deviceName: devInfoString[6],
);
}
}
}
} catch (e) {
debugPrint('initialize, Error: $e');
}
return ScanwedgeChannel._(supportedDevice: SupportedDevice.invalid);
}