listtable.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/head.dart';
  5. // import 'package:namer_app/header.dart';
  6. class ListTablePage extends StatelessWidget {
  7. const ListTablePage({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. 'Maintenance',
  27. style: TextStyle(color: Colors.black, fontSize: 48),
  28. ),
  29. ],
  30. )),
  31. Column(
  32. children: List.generate(
  33. 5,
  34. (i) => SizedBox(
  35. child: ListTile(
  36. leading: SizedBox(
  37. child: Icon(Icons.table_bar),
  38. ),
  39. title: Text(tables[i]['table']),
  40. trailing: ButtonUser(
  41. items: tables[i],
  42. ),
  43. ),
  44. )),
  45. ),
  46. ],
  47. ),
  48. ),
  49. ]),
  50. bottomNavigationBar: Footer(),
  51. );
  52. }
  53. }
  54. class ButtonUser extends StatelessWidget {
  55. final Map<String, dynamic> items;
  56. ButtonUser({
  57. required this.items,
  58. super.key,
  59. });
  60. //todo tombol item
  61. @override
  62. Widget build(BuildContext context) {
  63. return Row(
  64. mainAxisSize: MainAxisSize.min,
  65. children: [
  66. ElevatedButton(
  67. onPressed: null,
  68. style: ElevatedButton.styleFrom(
  69. backgroundColor: Colors.black,
  70. ),
  71. child: Text(
  72. 'Backup',
  73. style: TextStyle(color: Colors.white),
  74. ),
  75. ),
  76. ElevatedButton(
  77. onPressed: null,
  78. style: ElevatedButton.styleFrom(
  79. backgroundColor: Colors.black,
  80. ),
  81. child: Text(
  82. 'Restore',
  83. style: TextStyle(color: Colors.white),
  84. ),
  85. ),
  86. ],
  87. );
  88. }
  89. }