Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load asset: "packages/country_pickers/assets/us.png". #84

Open
GoxeeVladan opened this issue Sep 20, 2024 · 0 comments
Open

Comments

@GoxeeVladan
Copy link

GoxeeVladan commented Sep 20, 2024

i imported the package and try to use it by default but i get this error and my screen pops because of that

here is my usage:

class CountryPickerWidget extends StatelessWidget {
final bool filtered;

const CountryPickerWidget({Key? key, required this.filtered}) : super(key: key);

@OverRide
Widget build(BuildContext context) {
return Row(
children: [
CountryPickerDropdown(
initialValue: 'US', // Default value
itemBuilder: (Country country) {
context.read().add(UpdatePhoneCode('+${country.phoneCode}'));
return Container(
child: Row(
children: [
const SizedBox(width: 15),
CountryPickerUtils.getDefaultFlagImage(country),
const SizedBox(width: 8),
Text('+${country.phoneCode}'),
],
),
);
},
itemFilter: filtered ? (c) => ['US', 'CA'].contains(c.isoCode) : null,
onValuePicked: (Country country) {
// Dispatch the event to update the phone code
print('Country picked: ${country.isoCode}, phoneCode: +${country.phoneCode}');
context.read().add(UpdatePhoneCode('+${country.phoneCode}'));
},
),
],
);
}
}

and i refer to that widget as any other afterwards, this happened with latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant