creacion_pedido_screen.dart 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import 'package:flutter/material.dart';
  2. import 'package:turquessa_mesas_hoster/utils/widgets/custom_appbar.dart';
  3. import 'package:turquessa_mesas_hoster/utils/widgets/navigation_rail.dart';
  4. class CreacionPedido extends StatefulWidget {
  5. const CreacionPedido({super.key});
  6. @override
  7. State<CreacionPedido> createState() => _CreacionPedidoState();
  8. }
  9. class _CreacionPedidoState extends State<CreacionPedido> {
  10. final _selectedIndex = 0;
  11. @override
  12. Widget build(BuildContext context) {
  13. return Container(
  14. decoration: const BoxDecoration(
  15. gradient: LinearGradient(
  16. begin: Alignment.bottomRight,
  17. end: Alignment.topLeft,
  18. colors: [
  19. Color(0xFF7FD4D4),
  20. Color(0xFFE5E5E5),
  21. Color(0xFFFFFFFF),
  22. ])),
  23. child: Scaffold(
  24. backgroundColor: Colors.transparent,
  25. appBar: AppBar(
  26. title: const CustomAppbar(),
  27. ),
  28. body: Row(
  29. children: [
  30. CustomNavigationRail(selectedIndex: _selectedIndex),
  31. Expanded(
  32. flex: 5,
  33. child: Container(
  34. decoration: BoxDecoration(
  35. borderRadius: BorderRadius.circular(20),
  36. color: Colors.white,
  37. ),
  38. child: Column(
  39. children: [
  40. const CategoryFilters(),
  41. Expanded(
  42. child: Container(
  43. padding: const EdgeInsets.all(8),
  44. child: GridView.builder(
  45. gridDelegate:
  46. const SliverGridDelegateWithFixedCrossAxisCount(
  47. crossAxisCount: 4,
  48. crossAxisSpacing: 10,
  49. mainAxisSpacing: 10,
  50. ),
  51. itemCount: 20,
  52. itemBuilder: (context, index) {
  53. return Container(
  54. decoration: BoxDecoration(
  55. color: Colors.grey.shade200,
  56. borderRadius: BorderRadius.circular(20),
  57. ),
  58. child: Center(
  59. child: Text(
  60. 'Item $index',
  61. style: const TextStyle(fontSize: 20),
  62. ),
  63. ),
  64. );
  65. },
  66. ),
  67. ),
  68. ),
  69. ],
  70. ),
  71. ),
  72. ),
  73. Expanded(
  74. flex: 3,
  75. child: Container(
  76. decoration: BoxDecoration(
  77. borderRadius: BorderRadius.circular(20),
  78. color: Colors.white,
  79. ),
  80. child: const Text("test"),
  81. ),
  82. )
  83. ],
  84. ),
  85. ),
  86. );
  87. }
  88. }
  89. class CategoryFilters extends StatefulWidget {
  90. const CategoryFilters({super.key});
  91. @override
  92. State<CategoryFilters> createState() => CategoryFiltersState();
  93. }
  94. class CategoryFiltersState extends State<CategoryFilters> {
  95. @override
  96. Widget build(BuildContext context) {
  97. return Container(
  98. padding: const EdgeInsets.all(8),
  99. decoration: BoxDecoration(
  100. border: Border(bottom: BorderSide(color: Colors.grey.shade300)),
  101. ),
  102. child: Row(
  103. children: [
  104. // Buscador
  105. Expanded(
  106. child: Container(
  107. height: 40,
  108. padding: const EdgeInsets.symmetric(horizontal: 12),
  109. decoration: BoxDecoration(
  110. color: Colors.grey.shade200,
  111. borderRadius: BorderRadius.circular(20),
  112. ),
  113. child: Row(
  114. children: [
  115. Icon(Icons.search, color: Colors.grey.shade600),
  116. const SizedBox(width: 8),
  117. Text('Buscar', style: TextStyle(color: Colors.grey.shade600)),
  118. ],
  119. ),
  120. ),
  121. ),
  122. const SizedBox(width: 10),
  123. // Botones de filtro
  124. _FilterButtonPLaceHolder('Categoría'),
  125. const SizedBox(width: 10),
  126. _FilterButtonPLaceHolder('Topics'),
  127. const SizedBox(width: 10),
  128. _FilterButtonPLaceHolder('Extras'),
  129. ],
  130. ),
  131. );
  132. }
  133. }
  134. Widget _FilterButtonPLaceHolder(String text) {
  135. return Container(
  136. padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
  137. decoration: BoxDecoration(
  138. color: Colors.grey.shade200,
  139. borderRadius: BorderRadius.circular(4),
  140. ),
  141. child: Text(text, style: const TextStyle(fontSize: 16)),
  142. );
  143. }