listuser.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. import 'package:namer_app/datauser.dart';
  4. import 'package:namer_app/footer.dart';
  5. import 'package:namer_app/header.dart';
  6. class ListUserPage extends StatelessWidget {
  7. const ListUserPage({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 USER',
  26. style: TextStyle(color: Colors.black, fontSize: 48),
  27. ),
  28. ],
  29. )),
  30. Column(
  31. children: List.generate(
  32. 9,
  33. (i) => SizedBox(
  34. child: ListTile(
  35. leading: SizedBox(
  36. child: Icon(Icons.person),
  37. ),
  38. title: Text(users[i]['username']),
  39. subtitle: Text(users[i]['user']),
  40. trailing: ButtonUser(
  41. items: users[i],
  42. ),
  43. ),
  44. )),
  45. ),
  46. ],
  47. ),
  48. ),
  49. ]),
  50. bottomNavigationBar: Footer(),
  51. );
  52. }
  53. }
  54. class ButtonUser extends StatelessWidget {
  55. final Map<String, dynamic> items;
  56. ButtonUser({
  57. required this.items,
  58. super.key,
  59. });
  60. @override
  61. Widget build(BuildContext context) {
  62. return Row(
  63. mainAxisSize: MainAxisSize.min,
  64. children: [
  65. ElevatedButton(
  66. onPressed: () => context.go('/signup/listuser/edit'),
  67. style: ElevatedButton.styleFrom(
  68. backgroundColor: Colors.black,
  69. ),
  70. child: Text(
  71. 'Edit',
  72. style: TextStyle(color: Colors.white),
  73. ),
  74. ),
  75. ElevatedButton(
  76. //todo tombol item
  77. onPressed: null, //todo delete
  78. style: ElevatedButton.styleFrom(
  79. backgroundColor: Colors.black,
  80. ),
  81. child: Text(
  82. 'Delete',
  83. style: TextStyle(color: Colors.white),
  84. ),
  85. ),
  86. ],
  87. );
  88. }
  89. }