listplatform.dart 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. import 'package:namer_app/data/dataplatform.dart';
  4. import 'package:namer_app/footer.dart';
  5. import 'package:namer_app/header.dart';
  6. class ListPlatformPage extends StatelessWidget {
  7. const ListPlatformPage({super.key});
  8. @override
  9. Widget build(BuildContext context) {
  10. return Scaffold(
  11. appBar: CustomAppbar(),
  12. body: Stack(children: [
  13. SingleChildScrollView(
  14. child: Column(
  15. children: [
  16. Center(
  17. child: Row(
  18. mainAxisAlignment: MainAxisAlignment.center,
  19. children: [
  20. Text(
  21. 'LIST PLATFORM',
  22. style: TextStyle(color: Colors.black, fontSize: 48),
  23. ),
  24. ],
  25. )),
  26. Column(
  27. children: List.generate(
  28. 4,
  29. (i) => SizedBox(
  30. // height: 80,
  31. child: ListTile(
  32. // visualDensity: VisualDensity(vertical: 4),
  33. leading: SizedBox(
  34. child: Icon(Icons.phone),
  35. ),
  36. title: Text(platforms[i]['platform']),
  37. subtitle: Column(
  38. crossAxisAlignment: CrossAxisAlignment.start,
  39. children: [
  40. Text(platforms[i]['project']),
  41. Text(platforms[i]['owner'])
  42. ],
  43. ),
  44. trailing: ButtonUser(
  45. items: platforms[i],
  46. ),
  47. ),
  48. )),
  49. ),
  50. ],
  51. ),
  52. ),
  53. ]),
  54. bottomNavigationBar: Footer(),
  55. );
  56. }
  57. }
  58. class ButtonUser extends StatelessWidget {
  59. final Map<String, dynamic> items;
  60. ButtonUser({
  61. required this.items,
  62. super.key,
  63. });
  64. //todo edit platform
  65. //todo tombol item
  66. //todo tombol delete
  67. @override
  68. Widget build(BuildContext context) {
  69. return Row(
  70. mainAxisSize: MainAxisSize.min,
  71. children: [
  72. ElevatedButton(
  73. onPressed: () => context.go('/listplatform/editplatform'),
  74. style: ElevatedButton.styleFrom(
  75. backgroundColor: Colors.black,
  76. ),
  77. child: Text(
  78. 'Edit',
  79. style: TextStyle(color: Colors.white),
  80. ),
  81. ),
  82. ElevatedButton(
  83. onPressed: null,
  84. style: ElevatedButton.styleFrom(
  85. backgroundColor: Colors.black,
  86. ),
  87. child: Text(
  88. 'Delete',
  89. style: TextStyle(color: Colors.white),
  90. ),
  91. ),
  92. ElevatedButton(
  93. onPressed: () => context.go('/listplatform/listmember'),
  94. style: ElevatedButton.styleFrom(
  95. backgroundColor: Colors.black,
  96. ),
  97. child: Text(
  98. 'Member',
  99. style: TextStyle(color: Colors.white),
  100. ),
  101. ),
  102. ],
  103. );
  104. }
  105. }