Created
January 5, 2020 21:04
-
-
Save AliRadwan/02c62ab63edaf367ba0bd95c34b783ef to your computer and use it in GitHub Desktop.
CountriesBottomSheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _openCountriesBottomSheet(BuildContext context) { | |
showCupertinoModalPopup( | |
context: context, | |
builder: (BuildContext context) { | |
return Container( | |
// height: (MediaQuery.of(context).size.height / 2) + 100, | |
child: CupertinoActionSheet( | |
cancelButton: CupertinoButton( | |
child: Text( | |
allTranslations.text("cancel"), | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
color: Colors.blue, | |
), | |
), | |
onPressed: () => Navigator.of(context).pop(), | |
), | |
actions: cityModel.data.map( | |
(city) => | |
CupertinoButton( | |
child: Center( | |
child: Text( | |
city.name ?? "", | |
style: TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
color: Colors.black87, | |
), | |
), | |
), | |
onPressed: () { | |
setState(() { | |
// countryId = city.id; | |
cityName = city.name; | |
}); | |
// getProducts(countryId); | |
// _countryController.text = city.name; | |
// _formData["country_id"] = country.id; | |
// getCountryCities(country.id); | |
Navigator.of(context).pop(); | |
}, | |
), | |
) | |
.toList(), | |
), | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment