import 'dart:convert'; import 'package:flutter/services.dart'; class TestAssetBundle extends CachingAssetBundle { @override Future loadString(String key, {bool cache = true}) async { final ByteData data = await load(key); return utf8.decode(data.buffer.asUint8List()); } @override Future load(String key) async => rootBundle.load(key); }