listtable.dart 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import 'package:flutter/material.dart';
  2. import 'package:namer_app/data/datatable.dart';
  3. import 'package:namer_app/footer.dart';
  4. import 'package:namer_app/header.dart';
  5. class ListTablePage extends StatelessWidget {
  6. const ListTablePage({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Scaffold(
  10. appBar: CustomAppbar(),
  11. body: Stack(children: [
  12. SingleChildScrollView(
  13. child: Column(
  14. children: [
  15. Center(
  16. child: Row(
  17. mainAxisAlignment: MainAxisAlignment.center,
  18. children: [
  19. Text(
  20. 'Maintenance',
  21. style: TextStyle(color: Colors.black, fontSize: 48),
  22. ),
  23. ],
  24. )),
  25. Column(
  26. children: List.generate(
  27. 5,
  28. (i) => SizedBox(
  29. child: ListTile(
  30. leading: SizedBox(
  31. child: Icon(Icons.table_bar),
  32. ),
  33. title: Text(tables[i]['table']),
  34. trailing: ButtonUser(
  35. items: tables[i],
  36. ),
  37. ),
  38. )),
  39. ),
  40. ],
  41. ),
  42. ),
  43. ]),
  44. bottomNavigationBar: Footer(),
  45. );
  46. }
  47. }
  48. class ButtonUser extends StatelessWidget {
  49. final Map<String, dynamic> items;
  50. ButtonUser({
  51. required this.items,
  52. super.key,
  53. });
  54. //todo tombol item
  55. @override
  56. Widget build(BuildContext context) {
  57. return Row(
  58. mainAxisSize: MainAxisSize.min,
  59. children: [
  60. ElevatedButton(
  61. onPressed: null,
  62. style: ElevatedButton.styleFrom(
  63. backgroundColor: Colors.black,
  64. ),
  65. child: Text(
  66. 'Backup',
  67. style: TextStyle(color: Colors.white),
  68. ),
  69. ),
  70. ElevatedButton(
  71. onPressed: null,
  72. style: ElevatedButton.styleFrom(
  73. backgroundColor: Colors.black,
  74. ),
  75. child: Text(
  76. 'Restore',
  77. style: TextStyle(color: Colors.white),
  78. ),
  79. ),
  80. ],
  81. );
  82. }
  83. }