listcomment.dart 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:flutter/material.dart';
  2. import 'package:namer_app/data/datacomment.dart';
  3. import 'package:namer_app/footer.dart';
  4. import 'package:namer_app/head.dart';
  5. // import 'package:namer_app/header.dart';
  6. class ListCommentPage extends StatelessWidget {
  7. const ListCommentPage({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. appBar: CustomAppbar(),
  17. body: Stack(children: [
  18. SingleChildScrollView(
  19. child: Column(
  20. children: [
  21. Center(
  22. child: Row(
  23. mainAxisAlignment: MainAxisAlignment.center,
  24. children: [
  25. Text(
  26. 'LIST COMMENT',
  27. style: TextStyle(color: Colors.black, fontSize: 48),
  28. ),
  29. ],
  30. )),
  31. Column(
  32. children: List.generate(
  33. 4,
  34. (i) => SizedBox(
  35. child: ListTile(
  36. leading: SizedBox(
  37. child: Icon(Icons.chat),
  38. ),
  39. title: Text(comments[i]['comment']),
  40. subtitle: Column(
  41. crossAxisAlignment: CrossAxisAlignment.start,
  42. children: [
  43. Text(comments[i]['created']),
  44. Text(comments[i]['creator'])
  45. ],
  46. ),
  47. trailing: ButtonUser(
  48. items: comments[i],
  49. ),
  50. ),
  51. )),
  52. ),
  53. ],
  54. ),
  55. ),
  56. ]),
  57. bottomNavigationBar: Footer(),
  58. );
  59. }
  60. }
  61. class ButtonUser extends StatelessWidget {
  62. final Map<String, dynamic> items;
  63. ButtonUser({
  64. required this.items,
  65. super.key,
  66. });
  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. 'Delete',
  81. style: TextStyle(color: Colors.white),
  82. ),
  83. ),
  84. ],
  85. );
  86. }
  87. }