How can I use an image from third-party package asset in flutter?

I'm using this package in my pubspec.yaml

dependencies:
  country_code_picker: ^1.4.0

It is the repo: https://github.com/imtoori/CountryCodePicker

I would like to use the images from flags/ directory

What do I need to do to use them from Image.asset() in flutter ?

Upvotes: 1

Views: 162

Answers (1)

Sami Haddad
Sami Haddad

Reputation: 1416

You should specify the package:

Image.asset(
  'flags/ad.png',
  package: 'country_code_picker',
)

Upvotes: 1

Related Questions