listplatform.dart 2.8 KB

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