encode method

  1. @override
Uint8List encode(
  1. Object value
)
override

Implementation

@override
Uint8List encode(Object value) {
  if (value is List<Object>) {
    return encodeList(value);
  }
  if (value is String) {
    try {
      final array = json.decode(value) as List;
      final elements = array.map((e) => e.toString()).toList();
      return encodeList(elements);
    } catch (e) {
      throw Exception('Encode array type failed: $e');
    }
  }

  throw Exception('List value expected for type $name');
}