No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pengajuan_st.dart 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. import 'dart:convert';
  2. import 'dart:io';
  3. import 'package:file_picker/file_picker.dart';
  4. import 'package:flutter/cupertino.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:fluttertoast/fluttertoast.dart';
  7. import 'package:google_fonts/google_fonts.dart';
  8. import 'package:hris_selfservice_mobile/Screens/Menu/AjukanCuti/RequestHttp/jenisCuti_post.dart';
  9. import 'package:intl/intl.dart';
  10. import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
  11. import 'dart:developer' as logDev;
  12. import '../AjukanCuti/RequestHttp/pengajuanCuti_post.dart';
  13. import '../SlipGaji/background.dart';
  14. List<String> fileAttach = [""];
  15. TextEditingController deskripsiTeksController = TextEditingController();
  16. class PengajuanST_Screen extends StatefulWidget {
  17. const PengajuanST_Screen({Key? key}) : super(key: key);
  18. @override
  19. State<PengajuanST_Screen> createState() => _PengajuanST_Screen_State();
  20. }
  21. class _PengajuanST_Screen_State extends State<PengajuanST_Screen> {
  22. var selectedType;
  23. String _fileText = "";
  24. String _totalFile= "";
  25. bool visibleDateFrom = false;
  26. bool visibleDateTo = false;
  27. late List <String> idCutiType;
  28. late List <String> cutiType;
  29. DateTime dateFrom = DateTime.now();
  30. late String formattedDateFrom = "";
  31. late String idCuti;
  32. var selectedCategory;
  33. var selectedDate;
  34. int _value = 0;
  35. initState(){
  36. deskripsiTeksController.clear();
  37. cutiType = [""];
  38. idCutiType = [""];
  39. WidgetsBinding.instance.addPostFrameCallback((_) {
  40. cutiType = getJenisCuti();
  41. });
  42. super.initState();
  43. }
  44. getJenisCuti () {
  45. ProgressDialog loading = ProgressDialog(context);
  46. loading = ProgressDialog(context,
  47. type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
  48. loading.style(
  49. message: 'Please Wait .....',
  50. borderRadius: 3,
  51. backgroundColor: Colors.white,
  52. progressWidget: CircularProgressIndicator(),
  53. elevation: 10.0,
  54. padding: EdgeInsets.all(10),
  55. insetAnimCurve: Curves.easeInOut,
  56. progress: 0.0,
  57. maxProgress: 100.0,
  58. progressTextStyle: TextStyle(
  59. color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
  60. messageTextStyle: TextStyle(
  61. color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
  62. loading.show();
  63. JenisCuti_Post.connectToAPI().then((valueResult) async {
  64. Map<String, dynamic> object = json.decode(valueResult);
  65. if (object.containsKey("result").toString() == "true"){
  66. String result = object['result'].toString();
  67. logDev.log(result, name: "Jenis Cuti Result");
  68. if (result.contains("Failed")) {
  69. loading.hide();
  70. setState(() {
  71. cutiType = [""];
  72. alertDialogFailedRetrievedData(context);
  73. });
  74. } else {
  75. List <dynamic> jenis = object['result']['jenis'];
  76. setState(() {
  77. idCutiType.removeAt(0);
  78. cutiType.removeAt(0);
  79. for (int i = 0; i < jenis.length; i++){
  80. String id = jenis[i]['id'].toString();
  81. String text = jenis[i]['text'].toString();
  82. idCutiType.add(id);
  83. cutiType.add(text);
  84. }
  85. });
  86. loading.hide();
  87. }
  88. } else {
  89. setState((){
  90. cutiType = [""];
  91. alertDialogFailedResponse(context);
  92. /*Fluttertoast.showToast(
  93. msg: "Server Response Error",
  94. toastLength: Toast.LENGTH_SHORT,
  95. gravity: ToastGravity.CENTER,
  96. timeInSecForIosWeb: 1,
  97. textColor: Colors.white,
  98. fontSize: 16.0);*/
  99. });
  100. loading.hide();
  101. }
  102. });
  103. return cutiType;
  104. }
  105. @override
  106. Widget build(BuildContext context) {
  107. return Scaffold(
  108. body: SingleChildScrollView(
  109. child: Column(
  110. children: <Widget>[
  111. Stack(
  112. children: [
  113. WavyHeader(),
  114. Container(
  115. margin: EdgeInsets.only(top: 90),
  116. padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
  117. child: Row(
  118. mainAxisAlignment: MainAxisAlignment.end,
  119. crossAxisAlignment: CrossAxisAlignment.end,
  120. children: [
  121. Text(
  122. 'Submission\t\t',
  123. maxLines: 2,
  124. style: GoogleFonts.luckiestGuy(
  125. fontSize: 28,
  126. color: Colors.red,
  127. fontStyle: FontStyle.italic,
  128. ),
  129. ),
  130. Image.asset('assets/images/submit_st.png',
  131. width: 40,
  132. height: 40,
  133. ),
  134. ],
  135. )),
  136. SafeArea(
  137. child: Container(
  138. width: MediaQuery.of(context).size.width,
  139. margin: EdgeInsets.only(
  140. top: MediaQuery.of(context).size.height / 5,
  141. left: 10,
  142. right: 10,
  143. ),
  144. child: Column(
  145. children: [
  146. Container(
  147. child: Card(
  148. elevation: 10,
  149. child: Container(
  150. decoration: BoxDecoration(
  151. color: Color(0XFFFAF7EE),
  152. borderRadius: BorderRadius.circular(10)),
  153. child: Column(
  154. children: [
  155. Container(
  156. margin: EdgeInsets.only(
  157. left: 10, right: 10, top: 10, bottom: 10),
  158. child: Row(
  159. children: [
  160. Expanded(
  161. flex: 3,
  162. child: Text(
  163. 'Category',
  164. style: GoogleFonts.inconsolata(
  165. fontSize: 17),
  166. )),
  167. Expanded(
  168. flex: 7,
  169. child: Container(
  170. decoration: BoxDecoration(
  171. color:
  172. CupertinoColors.systemGrey2,
  173. borderRadius:
  174. BorderRadius.circular(5)),
  175. child: DropdownButton(
  176. value: this.selectedCategory,
  177. isExpanded: true,
  178. underline: SizedBox(),
  179. hint: Text(
  180. '\t\tChoose Category',
  181. style: TextStyle(
  182. color: Colors.black54),
  183. ),
  184. onChanged: (value) {
  185. print(value);
  186. setState(() {
  187. selectedCategory = value!;
  188. });
  189. },
  190. items: reimburseCategory
  191. .map(
  192. (e) => DropdownMenuItem(
  193. value: e,
  194. child:
  195. Text("\t\t\t" + e)),
  196. )
  197. .toList(),
  198. ),
  199. )),
  200. ],
  201. ),
  202. ),
  203. Container(
  204. margin: EdgeInsets.only(
  205. left: 10, right: 10, top: 10, bottom: 10),
  206. child: Column(
  207. children: [
  208. Row(
  209. children: [
  210. Expanded(
  211. flex: 3,
  212. child: Text(
  213. 'Date',
  214. style: GoogleFonts.inconsolata(
  215. fontSize: 17),
  216. )),
  217. Expanded(
  218. flex: 7,
  219. child: Column(
  220. children: [
  221. ElevatedButton(
  222. onPressed: () async {
  223. DateTime? newDate =
  224. await showDatePicker(
  225. context: context,
  226. initialDate: dateFrom,
  227. firstDate:
  228. DateTime(1900),
  229. lastDate:
  230. DateTime(2100));
  231. final DateFormat formatter = DateFormat('yyyy-MM-dd');
  232. if (newDate == null) {
  233. return;
  234. } else {
  235. setState(() {
  236. if (visibleDateFrom == false){
  237. visibleDateFrom = !visibleDateFrom;
  238. }
  239. formattedDateFrom = formatter.format(newDate);
  240. //dateFrom = formattedFrom as DateTime;
  241. });
  242. }
  243. },
  244. /*style: ElevatedButton.styleFrom(
  245. backgroundColor:
  246. CupertinoColors
  247. .systemGrey2),*/
  248. child: Container(
  249. width: double.infinity,
  250. child: Text(
  251. "Choose Date",
  252. style: TextStyle(
  253. color: Colors.white,
  254. fontSize: 16,
  255. fontWeight:
  256. FontWeight.w400),
  257. ),
  258. ),
  259. ),
  260. ],
  261. ),
  262. ),
  263. ],
  264. ),Row(
  265. children: [
  266. Expanded(
  267. flex: 3,
  268. child: Text(
  269. '',
  270. style: GoogleFonts.inconsolata(
  271. fontSize: 17),
  272. )),
  273. Expanded(
  274. flex: 7,
  275. child: Column(
  276. children: [
  277. Visibility(
  278. visible: visibleDateFrom,
  279. child: Container(
  280. alignment: Alignment.centerLeft,
  281. margin: EdgeInsets.only(
  282. left: 15,
  283. right: 15,
  284. bottom: 5),
  285. child: Text(formattedDateFrom,
  286. overflow:
  287. TextOverflow.ellipsis,
  288. maxLines: 1,
  289. style: TextStyle(
  290. color: Colors.black54),
  291. ),
  292. ),
  293. )
  294. ],
  295. ),
  296. ),
  297. ],
  298. ),
  299. ],
  300. ),
  301. ),
  302. Container(
  303. margin: EdgeInsets.only(
  304. left: 10, right: 10, top: 10, bottom: 10),
  305. child: Row(
  306. children: [
  307. Expanded(
  308. flex: 3,
  309. child: Text(
  310. 'Total Amount',
  311. style: GoogleFonts.inconsolata(
  312. fontSize: 17),
  313. )),
  314. Expanded(
  315. flex: 7,
  316. child: Container(
  317. decoration: BoxDecoration(
  318. color: Colors.white,
  319. borderRadius:
  320. BorderRadius.circular(5)),
  321. child: Padding(
  322. padding: EdgeInsets.only(
  323. left: 10,
  324. right: 10,
  325. top: 5,
  326. bottom: 5),
  327. child: TextFormField(
  328. keyboardType:
  329. TextInputType.number,
  330. maxLines: 1,
  331. textInputAction:
  332. TextInputAction.next,
  333. decoration: InputDecoration(
  334. border:
  335. InputBorder.none,
  336. hintText: "ex. 3000000")),
  337. ))),
  338. ],
  339. ),
  340. ),
  341. Container(
  342. margin: EdgeInsets.only(
  343. left: 10, right: 10, top: 10, bottom: 10),
  344. child: Row(
  345. children: [
  346. Expanded(
  347. flex: 3,
  348. child: Text(
  349. 'Description',
  350. style: GoogleFonts.inconsolata(
  351. fontSize: 17),
  352. )),
  353. Expanded(
  354. flex: 7,
  355. child: Container(
  356. decoration: BoxDecoration(
  357. color: Colors.white,
  358. borderRadius:
  359. BorderRadius.circular(5)),
  360. child: Padding(
  361. padding: EdgeInsets.only(
  362. left: 10,
  363. right: 10,
  364. top: 5,
  365. bottom: 5),
  366. child: TextFormField(
  367. keyboardType:
  368. TextInputType.multiline,
  369. maxLines: null,
  370. textInputAction:
  371. TextInputAction.done,
  372. decoration: InputDecoration(
  373. border:
  374. InputBorder.none,
  375. hintText: "description")),
  376. ))),
  377. ],
  378. ),
  379. ),
  380. Container(
  381. margin: EdgeInsets.only(
  382. left: 10, right: 10, top: 10, bottom: 10),
  383. child: Column(
  384. children: [
  385. Row(
  386. children: [
  387. Expanded(
  388. flex: 3,
  389. child: Text(
  390. 'Payment',
  391. style: GoogleFonts.inconsolata(
  392. fontSize: 17),
  393. )),
  394. Expanded(
  395. flex: 7,
  396. child: Container(
  397. child: Column(
  398. children: [
  399. Row(
  400. children: [
  401. Radio(
  402. value: 1,
  403. groupValue: _value,
  404. onChanged: (value) {
  405. setState(() {
  406. _value = value!;
  407. });
  408. },
  409. ),
  410. Flexible(
  411. child: Text(
  412. "Own (Need Reimburse)",
  413. style:
  414. TextStyle(
  415. color: Colors
  416. .black54,
  417. ))),
  418. ],
  419. ),
  420. Row(
  421. children: [
  422. Radio(
  423. value: 2,
  424. groupValue: _value,
  425. onChanged: (value) {
  426. setState(() {
  427. _value = value!;
  428. });
  429. },
  430. ),
  431. Flexible(
  432. child: Text(
  433. "Company",
  434. style: TextStyle(
  435. color: Colors
  436. .black54)))
  437. ],
  438. ),
  439. ],
  440. ),
  441. )),
  442. ],
  443. ),
  444. ],
  445. ),
  446. ),
  447. Container(
  448. margin: EdgeInsets.only(
  449. left: 10, right: 10, top: 10, bottom: 10),
  450. child: Column(
  451. children: [
  452. Row(
  453. children: [
  454. Expanded(
  455. flex: 3,
  456. child: Text(
  457. 'Attachment',
  458. style: GoogleFonts.inconsolata(
  459. fontSize: 17),
  460. ),
  461. ),
  462. Expanded(
  463. flex: 7,
  464. child: Container(
  465. child: ElevatedButton(
  466. onPressed: () {
  467. _pickMultipleFiles();
  468. },
  469. /*style: ElevatedButton.styleFrom(
  470. backgroundColor:
  471. CupertinoColors
  472. .systemGrey2),*/
  473. child: Container(
  474. width: double.infinity,
  475. child: Text("Choose File",
  476. style: TextStyle(
  477. color: Colors.white,
  478. fontSize: 16,
  479. fontWeight:
  480. FontWeight.w400)),
  481. ),
  482. ),
  483. ),
  484. )
  485. ],
  486. ),
  487. Row(
  488. children: [
  489. Expanded(
  490. flex: 3,
  491. child: Text(
  492. '',
  493. style: GoogleFonts.inconsolata(
  494. fontSize: 17),
  495. ),
  496. ),
  497. Expanded(
  498. flex: 7,
  499. child: Container(
  500. alignment:
  501. Alignment.centerLeft,
  502. margin: EdgeInsets.only(
  503. left: 15,
  504. right: 15,
  505. bottom: 10),
  506. child: Text(_totalFile + _fileText,
  507. overflow:
  508. TextOverflow.ellipsis,
  509. /*maxLines: 7,*/
  510. style: TextStyle(
  511. color: Colors.black54),
  512. ),
  513. ),
  514. )
  515. ],
  516. ),
  517. InkWell(
  518. child: Container(
  519. padding: EdgeInsets.fromLTRB(
  520. 10, 10, 10, 10),
  521. width: double.infinity,
  522. decoration: BoxDecoration(
  523. borderRadius:
  524. BorderRadius.circular(5),
  525. gradient: LinearGradient(colors: [
  526. Color(0xFFFF9945),
  527. Color(0xFFFc6076)
  528. ])),
  529. child: Text('Submit',
  530. textAlign: TextAlign.center,
  531. style: TextStyle(
  532. color: Colors.white,
  533. fontSize: 17,
  534. fontWeight: FontWeight.w500)),
  535. ),
  536. onTap: () {
  537. ProgressDialog loading = ProgressDialog(context);
  538. loading = ProgressDialog(context,
  539. type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
  540. loading.style(
  541. message: 'Please Wait .....',
  542. borderRadius: 3,
  543. backgroundColor: Colors.white,
  544. progressWidget: CircularProgressIndicator(),
  545. elevation: 10.0,
  546. padding: EdgeInsets.all(10),
  547. insetAnimCurve: Curves.easeInOut,
  548. progress: 0.0,
  549. maxProgress: 100.0,
  550. progressTextStyle: TextStyle(
  551. color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
  552. messageTextStyle: TextStyle(
  553. color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
  554. //loading.show();
  555. if (!validateFormCuti(context)){
  556. return;
  557. } else if (validateFormCuti(context)){
  558. /*loading.show();
  559. PengajuanCuti_Post.connectToAPI(idCuti, formattedDateFrom,
  560. formattedDateTo, deskripsiTeksController.text.toString(), fileAttach)
  561. .then((valueResult) async {
  562. Map<String, dynamic> object = json.decode(valueResult);
  563. logDev.log(fileAttach.toString(), name: "Attachment File Upload");
  564. if (object.containsKey("result").toString() == "true") {
  565. *//*String employee = object['result']['employee'].toString();
  566. String tipe = object['result']['tipe'].toString();
  567. String from = object['result']['from'].toString();
  568. String to = object['result']['to'].toString();
  569. String deskripsi = object['result']['deskripsi'].toString();
  570. String attachment = object['result']['attachment'].toString();*//*
  571. loading.hide();
  572. deskripsiTeksController.clear();
  573. Widget okButton = TextButton(
  574. child: Text("OK"),
  575. onPressed: () {
  576. Navigator.of(context, rootNavigator: true).pop();
  577. Navigator.pushReplacement(context, MaterialPageRoute(
  578. builder: (context) => AjukanCutiScreen()));
  579. },
  580. );
  581. // set up the AlertDialog
  582. AlertDialog alert = AlertDialog(
  583. title: Text("Employee Self Service"),
  584. content: Text("Berhasil Mengajukan Cuti"),
  585. actions: [
  586. okButton,
  587. ],
  588. );
  589. // show the dialog
  590. showDialog(
  591. context: context,
  592. builder: (BuildContext context) {
  593. return alert;
  594. },
  595. );
  596. *//* deskripsiTeksController.clear();
  597. formattedDateFrom = "";
  598. formattedDateTo = "";
  599. visibleDateFrom = false;
  600. visibleDateFrom = false;*//*
  601. } else if (object.containsKey("error").toString() == "true") {
  602. String errorMessage = object['error']['data']['message']
  603. .toString();
  604. loading.hide();
  605. Widget okButton = TextButton(
  606. child: Text("OK"),
  607. onPressed: () {
  608. Navigator.of(context, rootNavigator: true).pop();
  609. },
  610. );
  611. // set up the AlertDialog
  612. AlertDialog alert = AlertDialog(
  613. title: Text("Employee Self Service"),
  614. content: Text(errorMessage),
  615. actions: [
  616. okButton,
  617. ],
  618. );
  619. // show the dialog
  620. showDialog(
  621. context: context,
  622. builder: (BuildContext context) {
  623. return alert;
  624. },
  625. );
  626. }
  627. });*/
  628. }
  629. },
  630. )
  631. ],
  632. ),
  633. ),
  634. ],
  635. ),
  636. ),
  637. ),
  638. ),
  639. ],
  640. ),
  641. ),
  642. ),
  643. ],
  644. ),
  645. ],
  646. )),
  647. );
  648. }
  649. void _pickMultipleFiles() async {
  650. FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
  651. if (_fileText != ""){
  652. _fileText = "";
  653. }
  654. if (result != null) {
  655. List<File> files = result.paths.map((path) => File(path!)).toList();
  656. for (int i = 0; i< files.length; i++){
  657. String fileName = files[i].path.split('/').last;
  658. _fileText = _fileText + "\n" + fileName;
  659. List<int> fileInBytes = files[i].readAsBytesSync();
  660. String toBase64 = base64Encode(fileInBytes);
  661. fileAttach.add(toBase64);
  662. }
  663. fileAttach.removeAt(0);
  664. /*logDev.log(fileAttach.toString(), name: "File Attach Base64");*/
  665. logDev.log(fileAttach.length.toString(), name: "Length File Attach");
  666. logDev.log(files.toString(), name: "Files Picked");
  667. setState(() {
  668. _fileText;
  669. _totalFile = "Total File : " + files.length.toString();
  670. });
  671. } else {
  672. // User canceled the picker
  673. }
  674. }
  675. bool validateFormCuti(BuildContext context) {
  676. bool result = true;
  677. if (selectedType == null) {
  678. Fluttertoast.showToast(
  679. msg: "Tipe Cuti Belum Dipilih",
  680. toastLength: Toast.LENGTH_SHORT,
  681. gravity: ToastGravity.CENTER,
  682. timeInSecForIosWeb: 1,
  683. textColor: Colors.white,
  684. fontSize: 16.0);
  685. result = false;
  686. } else if (deskripsiTeksController.text.toString().isEmpty) {
  687. Fluttertoast.showToast(
  688. msg: "Deskripsi Harus Diisi",
  689. toastLength: Toast.LENGTH_SHORT,
  690. gravity: ToastGravity.CENTER,
  691. timeInSecForIosWeb: 1,
  692. textColor: Colors.white,
  693. fontSize: 16.0);
  694. result = false;
  695. }
  696. return result;
  697. }
  698. }
  699. alertDialogFailedRetrievedData(BuildContext context){
  700. Widget okButton = TextButton(
  701. child: Text("Refresh"),
  702. onPressed: () {
  703. /*Navigator.of(context, rootNavigator: true).pop();
  704. Navigator.pushReplacement(context, MaterialPageRoute(
  705. builder: (context) => AjukanCutiScreen()));*/
  706. },
  707. );
  708. Widget noButton = TextButton(
  709. child: Text("Back"),
  710. onPressed: () {
  711. Navigator.of(context, rootNavigator: true).pop();
  712. Navigator.pop(context);
  713. },
  714. );
  715. // set up the AlertDialog
  716. AlertDialog alert = AlertDialog(
  717. title: Text("Employee Self Service"),
  718. content: Text("Failed to Retrieve Data"),
  719. actions: [
  720. noButton,
  721. okButton,
  722. ],
  723. );
  724. // show the dialog
  725. showDialog(
  726. context: context,
  727. builder: (BuildContext context) {
  728. return alert;
  729. },
  730. );
  731. }
  732. alertDialogFailedResponse(BuildContext context){
  733. Widget okButton = TextButton(
  734. child: Text("Refresh"),
  735. onPressed: () {
  736. /* Navigator.of(context, rootNavigator: true).pop();
  737. Navigator.pushReplacement(context, MaterialPageRoute(
  738. builder: (context) => AjukanCutiScreen()));*/
  739. },
  740. );
  741. Widget noButton = TextButton(
  742. child: Text("Back"),
  743. onPressed: () {
  744. Navigator.of(context, rootNavigator: true).pop();
  745. Navigator.pop(context);
  746. },
  747. );
  748. // set up the AlertDialog
  749. AlertDialog alert = AlertDialog(
  750. title: Text("Employee Self Service"),
  751. content: Text("Server Response Error"),
  752. actions: [
  753. noButton,
  754. okButton,
  755. ],
  756. );
  757. // show the dialog
  758. showDialog(
  759. context: context,
  760. builder: (BuildContext context) {
  761. return alert;
  762. },
  763. );
  764. }
  765. List<String> reimburseCategory = [
  766. "Paid Time Off",
  767. "Sick Time Off",
  768. "Compensatory Days",
  769. "Unpaid"
  770. ];