country_picker_zaatra 0.1.2
country_picker_zaatra: ^0.1.2 copied to clipboard
A country picker widget that fetches data from an API, saves it locally, and includes a dropdown menu with flags, country codes, and country names.
0.0.1 #
- Initial Release.
0.0.2 #
- onValuePicked Callback: Added a onValuePicked callback that takes a String (country code) as an argument.
- selectedCountryCode: Added a variable to store the currently selected country code, initialized with the initialSelection value.
- initialSelection: Changed the parameter name to initialSelection for better clarity.
- Calling onValuePicked: Inside the onChanged callback, widget.onValuePicked?.call(newValue!) calls the callback function, passing the selected country code.
- Using code Key: Changed the DropdownMenuItem's value to use the country['code'] key.
0.0.3 #
- onValuePicked Callback: Modified to accept both the selected country code and name.
- selectedCountryName: Added a variable to store the selected country's official name.
- Initial Selection Logic: Added code in initState to set the initial selection based on the initialSelection property.
- DropdownMenuItem Value: Set to country['cca2'] to use the country code.
- DropdownMenuItem Child: Display country['name']['official'] to show the official name.
- onChanged Handling:
- Fetches the selected country's data from the countries list using firstWhere.
- Updates both selectedCountryCode and selectedCountryName.
- Calls onValuePicked with the code and name.
- Dropdown Hint: Added a hint to the dropdown using hint: const Text('Select Country').
0.0.4 #
- The line loading the asset now uses the correct path:
0.0.5 #
- Moved countries.json to assets.
- Changed Widget name according to the package.
0.0.6 #
- Reverted Widget name .
0.0.7 #
- Declared countries.json in yaml .
0.0.8 #
- corrected relative path from the country_picker.dart file to countries.json asset .
0.0.9 #
- bugfix.
0.1.0 #
- Major Code overhaul .
0.1.1 #
- Fixed the type mismatch error .
0.1.2 #
- Bugfix .