listplatform.dart 3.3 KB

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