暫無描述
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.

slipgaji_screen.dart 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:google_fonts/google_fonts.dart';
  4. import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/background.dart';
  5. class SlipGajiScreen extends StatefulWidget {
  6. const SlipGajiScreen({Key? key}) : super(key: key);
  7. @override
  8. State<SlipGajiScreen> createState() => _SlipGajiScreenState();
  9. }
  10. class _SlipGajiScreenState extends State<SlipGajiScreen> {
  11. var selectedDate;
  12. bool visible = false;
  13. @override
  14. Widget build(BuildContext context) {
  15. return Scaffold(
  16. body: SingleChildScrollView(
  17. child: Column(
  18. children: <Widget>[
  19. Stack(
  20. children: [
  21. WavyHeader(),
  22. Container(
  23. margin: EdgeInsets.only(top: 90),
  24. padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
  25. child: Row(
  26. mainAxisAlignment: MainAxisAlignment.end,
  27. crossAxisAlignment: CrossAxisAlignment.end,
  28. children: [
  29. Text(
  30. 'Slip Gaji\t\t',
  31. maxLines: 1,
  32. style: GoogleFonts.luckiestGuy(
  33. fontSize: 28,
  34. color: Colors.red,
  35. fontStyle: FontStyle.italic,
  36. ),
  37. ),
  38. Image.asset('assets/icons/ic_salary.png', width: 40, height: 40,),
  39. ],
  40. )
  41. ),
  42. SafeArea(
  43. child: Container(
  44. width: MediaQuery.of(context).size.width,
  45. margin: EdgeInsets.only(
  46. top: MediaQuery.of(context).size.height / 5,
  47. left: 15,
  48. right: 15,
  49. ),
  50. child: Column(
  51. children: [
  52. Container(
  53. margin: EdgeInsets.only(bottom: 20),
  54. child: Row(
  55. children: [
  56. Expanded(
  57. flex: 2,
  58. child: Text(
  59. 'Date\t:\t',
  60. style: GoogleFonts.inconsolata(fontSize: 20),
  61. )),
  62. Expanded(
  63. flex: 8,
  64. child: Container(
  65. decoration: BoxDecoration(
  66. color: CupertinoColors.systemGrey2,
  67. borderRadius: BorderRadius.circular(5)),
  68. child: DropdownButton(
  69. value: this.selectedDate,
  70. isExpanded: true,
  71. underline: SizedBox(),
  72. hint: Text(
  73. '\t\t\tChoose Date',
  74. style: TextStyle(color: Colors.black54),
  75. ),
  76. onChanged: (value) {
  77. print(value);
  78. setState(() {
  79. selectedDate = value!;
  80. if (selectedDate == value){
  81. visible = true;
  82. } else {
  83. visible = false;
  84. }
  85. });
  86. },
  87. items: dateList
  88. .map(
  89. (e) => DropdownMenuItem(
  90. value: e,
  91. child: Text("\t\t\t" + e)),
  92. )
  93. .toList(),
  94. ),
  95. )),
  96. ],
  97. ),
  98. ),
  99. Visibility(
  100. visible: visible,
  101. child: Text(
  102. 'Detail Slip Gaji Bulan ' + selectedDate.toString(),
  103. style: GoogleFonts.viga(
  104. fontSize: 15,
  105. fontWeight: FontWeight.bold,
  106. ),
  107. ),
  108. ),
  109. Visibility(
  110. visible: visible,
  111. child: Container(
  112. height: 200,
  113. child: Card(
  114. elevation: 7,
  115. child: Container(
  116. decoration: BoxDecoration(
  117. color: Color(0XFFFFFEFC),
  118. borderRadius: BorderRadius.circular(10))),
  119. ),
  120. )),
  121. Visibility(
  122. visible: visible,
  123. child: Container(
  124. alignment: Alignment.centerRight,
  125. child: ElevatedButton(
  126. onPressed: () {},
  127. style: ElevatedButton.styleFrom(),
  128. child: Text('Download Slip Gaji'),
  129. ),
  130. ),
  131. ),
  132. ],
  133. ),
  134. )),
  135. ],
  136. ),
  137. ],
  138. )),
  139. );
  140. }
  141. }
  142. List<String> dateList = [
  143. "September 2022",
  144. "Oktober 2022",
  145. "November 2022",
  146. "Desember 2022"
  147. ];
  148. const List<Color> Gradients1 = [
  149. Color(0xFF0EDED2),
  150. Color(0xFF03A0FE),
  151. ];