Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DropdownButtonFormField2(
- decoration: InputDecoration(
- isDense: true,
- contentPadding: EdgeInsets.zero,
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- isExpanded: true,
- hint: const Text(
- 'Pilih waktu shalat',
- style: TextStyle(fontSize: 14),
- ),
- icon: const Icon(
- Icons.arrow_drop_down,
- color: Colors.black45,
- ),
- iconSize: 30,
- buttonHeight: 60,
- buttonPadding: const EdgeInsets.only(left: 20, right: 10),
- dropdownDecoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15),
- ),
- items: [
- DropdownMenuItem(
- value: DateFormat('HH:mm').format(fajrTime),
- child: Text("Subuh: ${DateFormat('HH:mm').format(fajrTime)}")),
- DropdownMenuItem(
- value: sunriseTime.toString(),
- child:
- Text("Terbit: ${DateFormat('HH:mm').format(sunriseTime)}")),
- DropdownMenuItem(
- value: dhuha.toString(),
- child: Text("Dhuha: ${DateFormat('HH:mm').format(dhuha)}")),
- DropdownMenuItem(
- value: dhuhrTime.toString(),
- child:
- Text("Dhuhur: ${DateFormat('HH:mm').format(dhuhrTime)}")),
- DropdownMenuItem(
- value: asrTime.toString(),
- child: Text("Ashar: ${DateFormat('HH:mm').format(asrTime)}")),
- DropdownMenuItem(
- value: maghribTime.toString(),
- child: Text(
- "Maghrib: ${DateFormat('HH:mm').format(maghribTime)}")),
- DropdownMenuItem(
- value: ishaTime.toString(),
- child: Text("Isya: ${DateFormat('HH:mm').format(ishaTime)}")),
- ],
- validator: (value) {
- if (value == null) {
- return 'Pilih waktu shalat!';
- }
- return null;
- },
- onChanged: (value) {
- selectedWaktuShalat = DateTime.parse(value.toString());
- },
- onSaved: (value) {},
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement