Advertisement
Sebuahhobi98

DropdownButtonFormField2

Jul 9th, 2022
1,289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.28 KB | None | 0 0
  1. Future<List<DropdownMenuItem<String>>> get waktuShalat async {
  2.     await jws();
  3.     DateTime now = DateTime.now();
  4.     List<DropdownMenuItem<String>> menuItems = [
  5.       DropdownMenuItem(
  6.           value: _fajrTime.toString(),
  7.           child:
  8.               Text("Subuh: ${DateFormat('HH:mm').format(_fajrTime ?? now)}")),
  9.       DropdownMenuItem(
  10.           value: _sunriseTime.toString(),
  11.           child: Text(
  12.               "Terbit: ${DateFormat('HH:mm').format(_sunriseTime ?? now)}")),
  13.       DropdownMenuItem(
  14.           value: _dhuha.toString(),
  15.           child: Text("Dhuha: ${DateFormat('HH:mm').format(_dhuha ?? now)}")),
  16.       DropdownMenuItem(
  17.           value: _dhuhrTime.toString(),
  18.           child:
  19.               Text("Dhuhur: ${DateFormat('HH:mm').format(_dhuhrTime ?? now)}")),
  20.       DropdownMenuItem(
  21.           value: _asrTime.toString(),
  22.           child: Text("Ashar: ${DateFormat('HH:mm').format(_asrTime ?? now)}")),
  23.       DropdownMenuItem(
  24.           value: _maghribTime.toString(),
  25.           child: Text(
  26.               "Maghrib: ${DateFormat('HH:mm').format(_maghribTime ?? now)}")),
  27.       DropdownMenuItem(
  28.           value: _ishaTime.toString(),
  29.           child: Text("Isya: ${DateFormat('HH:mm').format(_ishaTime ?? now)}")),
  30.     ];
  31.     return menuItems;
  32.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement