0

PUBSPEC.YAML file

flutter:
  uses-material-design: true
  assets:
    - assets/images/
    - assets/fonts/
Container(
                                  height: 45,
                                  padding: EdgeInsets.all(6),
                                  decoration: BoxDecoration(
                                    color: Colors.green[300],
                                    borderRadius: BorderRadius.circular(10),
                                  ),
                                  child: Image.asset(
                                    'images/rupee.jpg',
                                    color: Colors.white,
                                  )),
                              Text(
                                'Online Payments',
                                style: TextStyle(
                                    fontSize: 17, fontWeight: FontWeight.w500),
                              )
                            ],
                          ),
                        ),
                      ),
jamesdlin
  • 81,374
  • 13
  • 159
  • 204
Mr.X
  • 3
  • 1
  • Follow this document https://docs.flutter.dev/development/ui/assets-and-images – Darshak May 05 '22 at 06:28
  • Does this answer your question? [FlutterError: Unable to load asset](https://stackoverflow.com/questions/53659809/fluttererror-unable-to-load-asset) – Darshak May 05 '22 at 06:30

1 Answers1

0

"assets/" is missing, you need to use asset image like below:

Image.asset(
  'assets/images/rupee.jpg',
  color: Colors.white,
))

ertgrull
  • 1,180
  • 9
  • 13