use asynccache

This commit is contained in:
shenlong-tanwen
2024-11-24 22:32:21 +05:30
parent 8450c8cc4f
commit 0e8b19e269
8 changed files with 35 additions and 23 deletions
+8
View File
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:isolate';
import 'dart:ui';
@@ -82,4 +83,11 @@ class IsolateHelper {
}
});
}
static Future<Map<String, dynamic>> decodeJson(Uint8List json) async {
return await Isolate.run(
() => const Utf8Decoder().fuse(const JsonDecoder()).convert(json)
as Map<String, dynamic>,
);
}
}