hifiaz / country-list-pick Goto Github PK
View Code? Open in Web Editor NEWFlutter package to show and pick country code
Home Page: https://pub.dev/packages/country_list_pick
License: MIT License
Flutter package to show and pick country code
Home Page: https://pub.dev/packages/country_list_pick
License: MIT License
While user did not select the country, it's preferable to maintain text like "Select Country" instead of Selecting [0]
selectedItem = elements[0];
By default. May be added to the Map?
I find misspelled in a patameter of LayoutBuilder
widget, which is in contrainsts
when it should be constraints
.
Is it possible to add a new selector isShownCode
to hide the country?
So that the default aspect of the picker can only be the flag.
Hi guys, after upgrading flutter to v2 I couldn't run my application anymore because "Method not found: 'ButtonTheme.bar'.", I tried installing 1.0.4, 1.1.0, 1.2.0, 1.2.1, 1.3.0 getting the same result.
Console complaint:
Xcode's output: ↳ ../../../SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/country_pickers-1.3.0/lib/utils/my_alert_dialog.dart:139:36: Error: Method not found: 'ButtonTheme.bar'. children.add(new ButtonTheme.bar(
It would be awesome if web support was added for this package
Please can you get possibility to change, the style of country text ?
Hi @hifiaz @giaotuancse,
I think if we have a ready page for using this lovely package for sign in or sign up, it will be nice thing!.
Whenever I scroll to the top of the country list an exception always happens in iOS which is:
RangeError (index): Invalid value: Not in inclusive range 0..241: -3
I traced the code and found that the problem is in selection_list.dart line 305:
String? countryName = countries.elementAt(scrollPosition).name;
when scrollPosition
is a negative number.
Fix:
Change the condition in line 304 to:
if (scrollPosition < countries.length && scrollPosition >= 0)
How can I increase the size of the widget in length? because currently if I have countries that are too big they are sometimes cut on 2 lines and it is not very aesthetic.
Can i change the text color of this?
Hello @hifiaz
I was recently building my project and it returned a warning: getFlutterEngine(): FlutterEngine' is deprecated. Deprecated in Java
I'm afraid it might lead o breakages in future builds.
If there's anything that can be done.
Thanks
You can't see anything in dark mode.
I am using country_list_pick: ^1.0.0+2
In the select country screen the search text field is really small because
Container( color: Colors.white, height: 50, child: TextField( controller: _controller, decoration: InputDecoration( border: InputBorder.none, focusedBorder: InputBorder.none, enabledBorder: InputBorder.none, errorBorder: InputBorder.none, disabledBorder: InputBorder.none, contentPadding: EdgeInsets.all(15), hintText: "Search...", ), onChanged: _filterElements, ), ),
Adding a height of 50 to the parent container and adding content padding of 15px works well for me.
For belgium, the name is Belgïe and i want Belgique
I noticed when using the country picker, the sidebar containing the alphabet letter of the countries does not update with what is displayed on screen. It would be nice if the sidebar updates with the current country's letter that is on screen as the user scrolls through the list.
════════ Exception caught by image resource service ════════════════════════════════════════════════
Unable to load asset: packages/country_list_pick/flags/af.png
════════════════════════════════════════════════════════════════════════════════════════════════════
<<<< [ +4 ms] Error while trying to load an asset: Failed to load asset at "assets/packages/country_list_pick/flags/cu.png" (404) >>>>
as this can be also used for forms and many users may need to enable/disable upon some acitivities.
It would be nice to have enable/disable option.
Hello ,
i have used and check your country list picker . i have notice that many country is not in your list its not use full.
Please update it.
The country theme misses property to the search country text field style.
If by default I have a app them with bodyLarge style then even warping it around with a Theme widget is not possible to override the style of the search text field.
Currently:
class CountryTheme {
final String? searchText;
final String? searchHintText;
final String? lastPickText;
final Color? alphabetSelectedBackgroundColor;
final Color? alphabetTextColor;
final Color? alphabetSelectedTextColor;
final bool? isShowTitle;
final bool? isShowFlag;
final bool? isShowCode;
final bool? isDownIcon;
final String? initialSelection;
final bool? showEnglishName;
final Color? labelColor;
CountryTheme({
this.labelColor,
this.searchText,
this.searchHintText,
this.lastPickText,
this.alphabetSelectedBackgroundColor,
this.alphabetTextColor,
this.alphabetSelectedTextColor,
this.isShowTitle,
this.isShowFlag,
this.isShowCode,
this.isDownIcon,
this.initialSelection,
this.showEnglishName,
});
}
I would suggest to add a property: searchTextColor or searchTextStyle
I can not set a placeholder string for the picker when the user see the picker for the first time, it will be cool to have something like "Select your country" or whatever the developer want to set.
Congrats for the lib, is amazing.
I tried to leave blank, but automatically, Afghanistan is selected.
I looked at the docs, and the source code, I think there is no way, right?
I found this at the source code:
So, when the empty value is passed, automatically Afghanistan will be chosen. Why?
when add country_list_pick: ^1.0.0+4
and then debug, it output a log:
Plugin project :country_list_pick not found. Please update settings.gradle.
Hi, nice library,
could you provide an appBar builder and a placeholder result builder instead of hardcoding the appbar (currently, the title is centered) and the result of the selection.
This is allow more custumization.
I can provide a pull request if you are willing to integrate it.
Hi @hifiaz @giaotuancse,
I think there is a bug in the package when I don't give parameter showEnglishName value, not like other parameters it doesn't happen any problem when I don't give them value!.
Or we could make it required just when parameter isShowTitle
is true
it would be nice to have the countries name with different languages: Arabic , French ...
First of all great library! Thanks for your hard work.
Would you consider improving accessibility for the country list? There's a warning for e.g. search button (top right corner).
This item may not have a label readable by screen readers.
Also the check button displays below the alphabet letters. Looks like it can also be improved.
It would be nice to have the following texts as parameters, to support custom locale configurations:
Added value could be:
If you want to not hardcode the alphabet list
List _alphabet = List.generate(26, (i) => String.fromCharCode('A'.codeUnitAt(0) + i)))
country-list-pick/lib/selection_list.dart
Line 61 in 0dc7f81
Hi can you kindly add the capability to change the color of the "Last pick" and "Search" text please?
dark mode support?
flutter pub get results in the following error after adding the plugin.
Invalid plugin specification country_list_pick.
Cannot find the flutter.plugin.platforms
key in the pubspec.yaml
file. An instruction to format the pubspec.yaml
can be found here:
https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms
+1 is the same dial code for Canada and for United States, so it's impossible to set United States as the initial country selected
When I use the pickerBuilder parameter to build the widget for the picker, before the country list fragment displays for picking the country, I can select a country. But when I use the countryBuilder to customize it. I cant select a country again.
there is a way to set a validator? and set a value empty because always show a Afghanistan country
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.