Answers for "flutter where to put assets"

5

image from assets in flutter

Widget build(BuildContext context) {
  return Image(image: AssetImage('graphics/background.png'));
}
Posted by: Guest on August-13-2021
0

Access files in flutter assets folder

final manifestJson = await DefaultAssetBundle.of(context).loadString('AssetManifest.json');
final images = json.decode(manifestJson).keys.where((String key) => key.startsWith('assets/images'));
Posted by: Guest on September-26-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language