diff --git a/lib/services/field_images.dart b/lib/services/field_images.dart index 781d7f93..f6dac855 100644 --- a/lib/services/field_images.dart +++ b/lib/services/field_images.dart @@ -25,9 +25,11 @@ class FieldImages { } static Future loadFields(String directory) async { - List filePaths = jsonDecode( - await rootBundle.loadString('AssetManifest.json')) - .keys + AssetManifest assetManifest = + await AssetManifest.loadFromAssetBundle(rootBundle); + + List filePaths = assetManifest + .listAssets() .where((String key) => key.contains(directory) && key.contains('.json')) .toList();