addbug.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. import 'package:flutter/material.dart';
  2. import 'package:namer_app/footer.dart';
  3. import 'package:namer_app/header.dart';
  4. import '../service/addbug_serv.dart';
  5. class AddBugPage extends StatelessWidget {
  6. const AddBugPage({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. var bugdesc = TextEditingController();
  10. var bugqc = TextEditingController();
  11. var bugdev = TextEditingController();
  12. var bugplatform = TextEditingController();
  13. var buggoodday = TextEditingController();
  14. var bugimage = TextEditingController();
  15. var buglevel = TextEditingController();
  16. var bugstatus = TextEditingController();
  17. var bugdevStatus = TextEditingController();
  18. return Scaffold(
  19. appBar: CustomAppbar(),
  20. backgroundColor: Colors.white,
  21. body: Stack(children: [
  22. SingleChildScrollView(
  23. child: Column(
  24. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  25. children: [
  26. Center(
  27. child: Row(
  28. mainAxisAlignment: MainAxisAlignment.center,
  29. children: [
  30. Text(
  31. 'ADD BUG',
  32. style: TextStyle(color: Colors.black, fontSize: 48),
  33. ),
  34. ],
  35. )),
  36. Column(
  37. children: [
  38. Padding(
  39. padding: const EdgeInsets.all(8.0),
  40. child: SizedBox(
  41. width: 396,
  42. child: TextField(
  43. decoration: InputDecoration(
  44. border: OutlineInputBorder(),
  45. focusedBorder: OutlineInputBorder(
  46. borderRadius:
  47. BorderRadius.all(Radius.circular(12)),
  48. borderSide: BorderSide(color: Colors.black)),
  49. enabledBorder: OutlineInputBorder(
  50. borderRadius:
  51. BorderRadius.all(Radius.circular(12)),
  52. borderSide: BorderSide(color: Colors.black)),
  53. labelText: 'Enter Description', //todo get data
  54. labelStyle: TextStyle(color: Colors.black),
  55. filled: true,
  56. fillColor: Colors.white.withOpacity(0.25)),
  57. cursorColor: Colors.black,
  58. style: TextStyle(color: Colors.black),
  59. controller: bugdesc,
  60. ),
  61. ),
  62. ),
  63. Padding(
  64. padding: const EdgeInsets.all(8.0),
  65. child: SizedBox(
  66. width: 396,
  67. child: TextField(
  68. decoration: InputDecoration(
  69. border: OutlineInputBorder(),
  70. focusedBorder: OutlineInputBorder(
  71. borderRadius:
  72. BorderRadius.all(Radius.circular(12)),
  73. borderSide: BorderSide(color: Colors.black)),
  74. enabledBorder: OutlineInputBorder(
  75. borderRadius:
  76. BorderRadius.all(Radius.circular(12)),
  77. borderSide: BorderSide(color: Colors.black)),
  78. labelText: 'Enter QC', //todo get data
  79. labelStyle: TextStyle(color: Colors.black),
  80. filled: true,
  81. fillColor: Colors.white.withOpacity(0.25)),
  82. cursorColor: Colors.black,
  83. style: TextStyle(color: Colors.black),
  84. controller: bugqc,
  85. ),
  86. ),
  87. ),
  88. Padding(
  89. padding: const EdgeInsets.all(8.0),
  90. child: SizedBox(
  91. width: 396,
  92. child: TextField(
  93. decoration: InputDecoration(
  94. border: OutlineInputBorder(),
  95. focusedBorder: OutlineInputBorder(
  96. borderRadius:
  97. BorderRadius.all(Radius.circular(12)),
  98. borderSide: BorderSide(color: Colors.black)),
  99. enabledBorder: OutlineInputBorder(
  100. borderRadius:
  101. BorderRadius.all(Radius.circular(12)),
  102. borderSide: BorderSide(color: Colors.black)),
  103. labelText: 'Enter Dev', //todo get data
  104. labelStyle: TextStyle(color: Colors.black),
  105. filled: true,
  106. fillColor: Colors.white.withOpacity(0.25)),
  107. cursorColor: Colors.black,
  108. style: TextStyle(color: Colors.black),
  109. controller: bugdev,
  110. ),
  111. ),
  112. ),
  113. Padding(
  114. padding: const EdgeInsets.all(8.0),
  115. child: SizedBox(
  116. width: 396,
  117. child: TextField(
  118. decoration: InputDecoration(
  119. border: OutlineInputBorder(),
  120. focusedBorder: OutlineInputBorder(
  121. borderRadius:
  122. BorderRadius.all(Radius.circular(12)),
  123. borderSide: BorderSide(color: Colors.black)),
  124. enabledBorder: OutlineInputBorder(
  125. borderRadius:
  126. BorderRadius.all(Radius.circular(12)),
  127. borderSide: BorderSide(color: Colors.black)),
  128. labelText: 'Enter Platform', //todo get data
  129. labelStyle: TextStyle(color: Colors.black),
  130. filled: true,
  131. fillColor: Colors.white.withOpacity(0.25)),
  132. cursorColor: Colors.black,
  133. style: TextStyle(color: Colors.black),
  134. controller: bugplatform,
  135. ),
  136. ),
  137. ),
  138. Padding(
  139. padding: const EdgeInsets.all(8.0),
  140. child: SizedBox(
  141. width: 396,
  142. child: TextField(
  143. decoration: InputDecoration(
  144. border: OutlineInputBorder(),
  145. focusedBorder: OutlineInputBorder(
  146. borderRadius:
  147. BorderRadius.all(Radius.circular(12)),
  148. borderSide: BorderSide(color: Colors.black)),
  149. enabledBorder: OutlineInputBorder(
  150. borderRadius:
  151. BorderRadius.all(Radius.circular(12)),
  152. borderSide: BorderSide(color: Colors.black)),
  153. labelText: 'Enter Goodday URL', //todo get data
  154. labelStyle: TextStyle(color: Colors.black),
  155. filled: true,
  156. fillColor: Colors.white.withOpacity(0.25)),
  157. cursorColor: Colors.black,
  158. style: TextStyle(color: Colors.black),
  159. controller: buggoodday,
  160. ),
  161. ),
  162. ),
  163. Padding(
  164. padding: const EdgeInsets.all(8.0),
  165. child: SizedBox(
  166. width: 396,
  167. child: TextField(
  168. decoration: InputDecoration(
  169. border: OutlineInputBorder(),
  170. focusedBorder: OutlineInputBorder(
  171. borderRadius:
  172. BorderRadius.all(Radius.circular(12)),
  173. borderSide: BorderSide(color: Colors.black)),
  174. enabledBorder: OutlineInputBorder(
  175. borderRadius:
  176. BorderRadius.all(Radius.circular(12)),
  177. borderSide: BorderSide(color: Colors.black)),
  178. labelText: 'Enter Image URL', //todo get data
  179. labelStyle: TextStyle(color: Colors.black),
  180. filled: true,
  181. fillColor: Colors.white.withOpacity(0.25)),
  182. cursorColor: Colors.black,
  183. style: TextStyle(color: Colors.black),
  184. controller: bugimage,
  185. ),
  186. ),
  187. ),
  188. Padding(
  189. padding: const EdgeInsets.all(8.0),
  190. child: SizedBox(
  191. width: 396,
  192. child: TextField(
  193. decoration: InputDecoration(
  194. border: OutlineInputBorder(),
  195. focusedBorder: OutlineInputBorder(
  196. borderRadius:
  197. BorderRadius.all(Radius.circular(12)),
  198. borderSide: BorderSide(color: Colors.black)),
  199. enabledBorder: OutlineInputBorder(
  200. borderRadius:
  201. BorderRadius.all(Radius.circular(12)),
  202. borderSide: BorderSide(color: Colors.black)),
  203. labelText: 'Enter Level', //todo get data
  204. labelStyle: TextStyle(color: Colors.black),
  205. filled: true,
  206. fillColor: Colors.white.withOpacity(0.25)),
  207. cursorColor: Colors.black,
  208. style: TextStyle(color: Colors.black),
  209. controller: buglevel,
  210. ),
  211. ),
  212. ),
  213. Padding(
  214. padding: const EdgeInsets.all(8.0),
  215. child: SizedBox(
  216. width: 396,
  217. child: TextField(
  218. decoration: InputDecoration(
  219. border: OutlineInputBorder(),
  220. focusedBorder: OutlineInputBorder(
  221. borderRadius:
  222. BorderRadius.all(Radius.circular(12)),
  223. borderSide: BorderSide(color: Colors.black)),
  224. enabledBorder: OutlineInputBorder(
  225. borderRadius:
  226. BorderRadius.all(Radius.circular(12)),
  227. borderSide: BorderSide(color: Colors.black)),
  228. labelText: 'Enter Status', //todo get data
  229. labelStyle: TextStyle(color: Colors.black),
  230. filled: true,
  231. fillColor: Colors.white.withOpacity(0.25)),
  232. cursorColor: Colors.black,
  233. style: TextStyle(color: Colors.black),
  234. controller: bugstatus,
  235. ),
  236. ),
  237. ),
  238. Padding(
  239. padding: const EdgeInsets.all(8.0),
  240. child: SizedBox(
  241. width: 396,
  242. child: TextField(
  243. decoration: InputDecoration(
  244. border: OutlineInputBorder(),
  245. focusedBorder: OutlineInputBorder(
  246. borderRadius:
  247. BorderRadius.all(Radius.circular(12)),
  248. borderSide: BorderSide(color: Colors.black)),
  249. enabledBorder: OutlineInputBorder(
  250. borderRadius:
  251. BorderRadius.all(Radius.circular(12)),
  252. borderSide: BorderSide(color: Colors.black)),
  253. labelText: 'Enter Dev Status', //todo get data
  254. labelStyle: TextStyle(color: Colors.black),
  255. filled: true,
  256. fillColor: Colors.white.withOpacity(0.25)),
  257. cursorColor: Colors.black,
  258. style: TextStyle(color: Colors.black),
  259. controller: bugdevStatus,
  260. ),
  261. ),
  262. ),
  263. Padding(
  264. padding: const EdgeInsets.all(20.0),
  265. child: SizedBox(
  266. width: 396,
  267. height: 61,
  268. child: ElevatedButton(
  269. onPressed: () => addbug(context, bugdesc.text, bugqc.text, bugdev.text, bugplatform.text, buggoodday.text, bugimage.text, buglevel.text, bugstatus.text, bugdevStatus.text), //todo save edit
  270. style: ElevatedButton.styleFrom(
  271. backgroundColor: Colors.black, //todo putih lage
  272. side: BorderSide(color: Colors.white),
  273. shape: RoundedRectangleBorder(
  274. borderRadius: BorderRadius.circular(12.0),
  275. ),
  276. ),
  277. child: Text(
  278. 'Save',
  279. style: TextStyle(color: Colors.white),
  280. ),
  281. ),
  282. ),
  283. ),
  284. ],
  285. ),
  286. ],
  287. ),
  288. ),
  289. ]),
  290. bottomNavigationBar: Footer(),
  291. );
  292. }
  293. }