v3.0.1country_pickers
देश, कोड, झंडे और उन्हें चुनने के कई तरीके आपके सेवा में... एक विजेट के दूर...
179लाइक 60.3 हज़ार30-दिन डाउनलोड150Pub अंक
AndroidiOSWebmacOSWindowsLinux
देश, कोड, झंडे और उन्हें चुनने के कई तरीके आपके सेवा में... एक विजेट के दूर...
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Countries, codes, flags and several way of picking them at your service...one widget away...
CountryPickerDropdown(
initialValue: 'AR',
itemBuilder: _buildDropdownItem,
itemFilter: ['AR', 'DE', 'GB', 'CN'].contains(c.isoCode),
priorityList:[
CountryPickerUtils.getCountryByIsoCode('GB'),
CountryPickerUtils.getCountryByIsoCode('CN'),
],
sortComparator: (Country a, Country b) => a.isoCode.compareTo(b.isoCode),
onValuePicked: (Country country) {
print("${country.name}");
},
)
Widget _buildDropdownItem(Country country) => Container(
child: Row(
children: <Widget>[
CountryPickerUtils.getDefaultFlagImage(country),
SizedBox(
width: 8.0,
),
Text("+${country.phoneCode}(${country.isoCode})"),
],
),
);
void _openCountryPickerDialog() => showDialog(
context: context,
builder: (context) => Theme(
data: Theme.of(context).copyWith(primaryColor: Colors.pink),
child: CountryPickerDialog(
titlePadding: EdgeInsets.all(8.0),
searchCursorColor: Colors.pinkAccent,
searchInputDecoration: InputDecoration(hintText: 'Search...'),
isSearchable: true,
title: Text('Select your phone code'),
onValuePicked: (Country country) =>
setState(() => _selectedDialogCountry = country),
itemFilter: (c) => ['AR', 'DE', 'GB', 'CN'].contains(c.isoCode),
priorityList: [
CountryPickerUtils.getCountryByIsoCode('TR'),
CountryPickerUtils.getCountryByIsoCode('US'),
],
itemBuilder: _buildDialogItem)),
);
void _openCupertinoCountryPicker() => showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) {
return CountryPickerCupertino(
pickerSheetHeight: 300.0,
onValuePicked: (Country country) =>
setState(() => _selectedCupertinoCountry = country),
itemFilter: (c) => ['AR', 'DE', 'GB', 'CN'].contains(c.isoCode),
priorityList: [
CountryPickerUtils.getCountryByIsoCode('TR'),
CountryPickerUtils.getCountryByIsoCode('US'),
],
);
});
Thanks goes to country-flags repo for the flag image assets.
निर्भरता सूची 3 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}^4.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗