12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import 'package:flutter/material.dart';
- import 'package:go_router/go_router.dart';
- import 'package:namer_app/data/datauser.dart';
- import 'package:namer_app/footer.dart';
- import 'package:namer_app/header.dart';
- class ListUserPage extends StatelessWidget {
- const ListUserPage({super.key});
- @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 USER',
- style: TextStyle(color: Colors.black, fontSize: 48),
- ),
- ],
- )),
- Column(
- children: List.generate(
- 9,
- (i) => SizedBox(
- child: ListTile(
- visualDensity: VisualDensity(vertical: 4),
- leading: SizedBox(
- child: Icon(Icons.person),
- ),
- title: Text(users[i]['username']),
- subtitle: Text(users[i]['user']),
- trailing: ButtonUser(items: users[i]),
- ),
- )),
- ),
- ],
- ),
- ),
- ]),
- bottomNavigationBar: Footer(),
- );
- }
- }
- class ButtonUser extends StatelessWidget {
- final Map<String, dynamic> items;
- ButtonUser({
- required this.items,
- super.key,
- });
- @override
- Widget build(BuildContext context) {
- return Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- ElevatedButton(
- onPressed: () => context.go('/signup/listuser/edit'),
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.black,
- ),
- child: Text(
- 'Edit',
- style: TextStyle(color: Colors.white),
- ),
- ),
- ElevatedButton(
- //todo tombol item
- onPressed: null, //todo delete
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.black,
- ),
- child: Text(
- 'Delete',
- style: TextStyle(color: Colors.white),
- ),
- ),
- ],
- );
- }
- }
|