listbug.dart 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. import 'package:namer_app/data/databug.dart';
  4. import 'package:namer_app/footer.dart';
  5. import 'package:namer_app/head.dart';
  6. // import 'package:namer_app/header.dart';
  7. class ListBugPage extends StatelessWidget {
  8. const ListBugPage({super.key});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Scaffold(
  12. // appBar: Header(
  13. // title: Text('title'),
  14. // appBar: AppBar(),
  15. // widgets: <Widget>[Icon(Icons.more_vert)],
  16. // ),
  17. appBar: CustomAppbar(),
  18. body: Stack(children: [
  19. SingleChildScrollView(
  20. child: Column(
  21. children: [
  22. Center(
  23. child: Row(
  24. mainAxisAlignment: MainAxisAlignment.center,
  25. children: [
  26. Text(
  27. 'LIST BUG',
  28. style: TextStyle(color: Colors.black, fontSize: 48),
  29. ),
  30. ],
  31. )),
  32. Column(
  33. children: List.generate(
  34. 2,
  35. (i) => SizedBox(
  36. // height: 80,
  37. child: ListTile(
  38. // visualDensity: VisualDensity(vertical: 4),
  39. leading: SizedBox(
  40. child: Icon(Icons.bug_report),
  41. ),
  42. title: Text(bugs[i]['bug']),
  43. subtitle: Column(
  44. crossAxisAlignment: CrossAxisAlignment.start,
  45. children: [
  46. Text(bugs[i]['goodday']),
  47. Row(
  48. children: [
  49. Text(bugs[i]['created']),
  50. Container(
  51. width: 30,
  52. ),
  53. Text(bugs[i]['level']),
  54. ],
  55. ),
  56. Row(
  57. children: [
  58. Text(bugs[i]['qc']),
  59. Container(
  60. width: 20,
  61. ),
  62. Text(bugs[i]['status']),
  63. Container(
  64. width: 20,
  65. ),
  66. Text(bugs[i]['programmer']),
  67. Container(
  68. width: 20,
  69. ),
  70. Text(bugs[i]['dev_status'])
  71. ],
  72. )
  73. ],
  74. ),
  75. trailing: ButtonUser(
  76. items: bugs[i],
  77. ),
  78. ),
  79. )),
  80. ),
  81. ],
  82. ),
  83. ),
  84. ]),
  85. bottomNavigationBar: Footer(),
  86. );
  87. }
  88. }
  89. class ButtonUser extends StatelessWidget {
  90. final Map<String, dynamic> items;
  91. ButtonUser({
  92. required this.items,
  93. super.key,
  94. });
  95. //todo tombol item
  96. //todo tombol delete
  97. @override
  98. Widget build(BuildContext context) {
  99. return Row(
  100. mainAxisSize: MainAxisSize.min,
  101. children: [
  102. ElevatedButton(
  103. onPressed: () => context.go('/login/bug/editbug'),
  104. style: ElevatedButton.styleFrom(
  105. backgroundColor: Colors.black,
  106. ),
  107. child: Text(
  108. 'Edit',
  109. style: TextStyle(color: Colors.white),
  110. ),
  111. ),
  112. ElevatedButton(
  113. onPressed: null,
  114. style: ElevatedButton.styleFrom(
  115. backgroundColor: Colors.black,
  116. ),
  117. child: Text(
  118. 'Delete',
  119. style: TextStyle(color: Colors.white),
  120. ),
  121. ),
  122. ElevatedButton(
  123. onPressed: () => context.go('/login/bug/comment'),
  124. style: ElevatedButton.styleFrom(
  125. backgroundColor: Colors.black,
  126. ),
  127. child: Text(
  128. 'Comment',
  129. style: TextStyle(color: Colors.white),
  130. ),
  131. ),
  132. ],
  133. );
  134. }
  135. }