toMap method

Map<String, dynamic> toMap()

Convert this configuration to a map that can be passed to the platform channel

Implementation

Map<String, dynamic> toMap() {
  final Map<String, dynamic> map = {
    'language': language,
    'engine': engine.toString().split('.').last,
  };

  if (tessDataPath != null) {
    map['tessDataPath'] = tessDataPath;
  }

  if (options != null) {
    map.addAll(options!);
  }

  return map;
}