listbug.dart 3.9 KB

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