listtable.dart 2.4 KB

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