1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import 'package:flutter/material.dart';
- import 'package:namer_app/data/datacomment.dart';
- import 'package:namer_app/footer.dart';
- import 'package:namer_app/header.dart';
- class ListCommentPage extends StatefulWidget {
- const ListCommentPage({super.key});
- @override
- State<ListCommentPage> createState() => _ListCommentPageState();
- }
- class _ListCommentPageState extends State<ListCommentPage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: CustomAppbar(),
- body: Stack(children: [
- SingleChildScrollView(
- child: Column(
- children: [
- Center(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text(
- 'LIST COMMENT',
- style: TextStyle(color: Colors.black, fontSize: 48),
- ),
- ],
- )),
- Column(
- children: List.generate(
- 4,
- (i) => SizedBox(
- child: ListTile(
- leading: SizedBox(
- child: Icon(Icons.chat),
- ),
- title: Text(comments[i]['comment']),
- subtitle: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(comments[i]['created']),
- Text(comments[i]['creator'])
- ],
- ),
- trailing: ButtonUser(
- items: comments[i],
- ),
- ),
- )),
- ),
- ],
- ),
- ),
- ]),
- bottomNavigationBar: Footer(),
- );
- }
- }
- class ButtonUser extends StatelessWidget {
- final Map<String, dynamic> items;
- ButtonUser({
- required this.items,
- super.key,
- });
- //todo tombol item
- //todo tombol delete
- @override
- Widget build(BuildContext context) {
- return Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- ElevatedButton(
- onPressed: null,
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.black,
- ),
- child: Text(
- 'Delete',
- style: TextStyle(color: Colors.white),
- ),
- ),
- ],
- );
- }
- }
|