Skip to content

Instantly share code, notes, and snippets.

@AliRadwan
Created January 5, 2020 21:04
Show Gist options
  • Save AliRadwan/02c62ab63edaf367ba0bd95c34b783ef to your computer and use it in GitHub Desktop.
Save AliRadwan/02c62ab63edaf367ba0bd95c34b783ef to your computer and use it in GitHub Desktop.
CountriesBottomSheet
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