isolate_json 2.1.0+1 isolate_json: ^2.1.0+1 copied to clipboard
Library for using a long-lived isolate for JSON encoding and decoding.
example/isolate_json_example.dart
import 'package:isolate_json/isolate_json.dart';
Future<void> main() async {
await JsonIsolate().startIsolate();
final json = '{"name":"John", "age":30, "car":null}';
final output1 = await JsonIsolate().decodeJson(json);
final output2 = await JsonIsolate().encodeJson({
'jsonData': true,
});
final output3 = await JsonIsolate().encodeJson([1, 2, 3]);
print(output1);
print(output2);
print(output3);
JsonIsolate().dispose();
}