import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:namer_app/dataplatform.dart'; import 'package:namer_app/footer.dart'; import 'package:namer_app/head.dart'; // import 'package:namer_app/header.dart'; class ListPlatformPage extends StatelessWidget { const ListPlatformPage({super.key}); @override Widget build(BuildContext context) { return Scaffold( // appBar: Header( // title: Text('title'), // appBar: AppBar(), // widgets: [Icon(Icons.more_vert)], // ), appBar: CustomAppbar(), body: Stack(children: [ SingleChildScrollView( child: Column( children: [ Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'LIST PLATFORM', style: TextStyle(color: Colors.black, fontSize: 48), ), ], )), Column( children: List.generate( 4, (i) => SizedBox( // height: 80, child: ListTile( // visualDensity: VisualDensity(vertical: 4), leading: SizedBox( child: Icon(Icons.phone), ), title: Text(platforms[i]['platform']), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(platforms[i]['project']), Text(platforms[i]['owner']) ], ), trailing: ButtonUser( items: platforms[i], ), ), )), ), ], ), ), ]), bottomNavigationBar: Footer(), ); } } class ButtonUser extends StatelessWidget { final Map items; ButtonUser({ required this.items, super.key, }); //todo edit platform //todo tombol item //todo tombol delete @override Widget build(BuildContext context) { return Row( mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( onPressed: () => context.go('/listplatform/editplatform'), style: ElevatedButton.styleFrom( backgroundColor: Colors.black, ), child: Text( 'Edit', style: TextStyle(color: Colors.white), ), ), ElevatedButton( onPressed: null, style: ElevatedButton.styleFrom( backgroundColor: Colors.black, ), child: Text( 'Delete', style: TextStyle(color: Colors.white), ), ), ElevatedButton( onPressed: () => context.go('/listplatform/listmember'), style: ElevatedButton.styleFrom( backgroundColor: Colors.black, ), child: Text( 'Member', style: TextStyle(color: Colors.white), ), ), ], ); } }