项目作者: biessek

项目描述 :
A Flutter Country Picker Widget with support to country dialing codes
高级语言: Dart
项目地址: git://github.com/biessek/flutter_country_picker.git
创建时间: 2018-07-06T01:03:58Z
项目社区:https://github.com/biessek/flutter_country_picker

开源协议:MIT License

下载


Pub

flutter_country_picker

A Flutter Country Picker Widget with support to country dialing codes


Usage

Add the CountryPicker widget in your layout and use the onChanged callback.
Full example

  1. ///full Great Britain sample.
  2. ///static const Country GB = Country(
  3. /// asset: "assets/flags/gb_flag.png",
  4. /// dialingCode: "44",
  5. /// isoCode: "GB",
  6. /// name: "United Kingdom",
  7. /// currency: "British pound",
  8. /// currencyISO: "GBP",
  9. /// );
  10. @override
  11. Widget build(BuildContext context) {
  12. return new Scaffold(
  13. appBar: new AppBar(
  14. title: Text('Flutter Country Picker Demo'),
  15. ),
  16. body: new Center(
  17. child: CountryPicker(
  18. dense: false,
  19. showFlag: true, //displays flag, true by default
  20. showDialingCode: false, //displays dialing code, false by default
  21. showName: true, //displays country name, true by default
  22. showCurrency: false, //eg. 'British pound'
  23. showCurrencyISO: true, //eg. 'GBP'
  24. onChanged: (Country country) {
  25. setState(() {
  26. _selected = country;
  27. });
  28. },
  29. selectedCountry: _selected,
  30. ),
  31. ),
  32. );
  33. }