We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58e6e00 commit 2439311Copy full SHA for 2439311
1 file changed
lib/services/json_service.dart
@@ -1,4 +1,5 @@
1
import 'dart:convert';
2
+import 'dart:isolate';
3
import 'package:flutter/services.dart';
4
5
const String basePath = 'assets/bibles';
@@ -10,6 +11,8 @@ class JsonService {
10
11
12
Future<Map<String, dynamic>> loadJsonFromAssets(String path) async {
13
final String data = await rootBundle.loadString(path);
- return json.decode(data);
14
+ return await Isolate.run<Map<String, dynamic>>(() {
15
+ return json.decode(data);
16
+ });
17
}
18
0 commit comments