creacion_pedido_screen.dart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.fromARGB(255, 141, 225, 225),
  21. Color.fromARGB(255, 74, 156, 156),
  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: const BoxDecoration(
  35. color: Colors.white,
  36. ),
  37. child: const Column(
  38. children: [
  39. CategoryFilters(),
  40. CategoryGrid(),
  41. ],
  42. ),
  43. ),
  44. ),
  45. Expanded(
  46. flex: 4,
  47. child: Container(
  48. decoration: const BoxDecoration(
  49. color: Colors.white,
  50. ),
  51. child: Padding(
  52. padding: const EdgeInsets.all(8.0),
  53. child: Column(
  54. crossAxisAlignment: CrossAxisAlignment.start,
  55. children: [
  56. const Padding(
  57. padding: EdgeInsets.only(left: 10),
  58. child: Text(
  59. "Mesa 3: Palmeras",
  60. textAlign: TextAlign.start,
  61. style: TextStyle(
  62. fontSize: 40,
  63. fontWeight: FontWeight.bold,
  64. color: Colors.black),
  65. ),
  66. ),
  67. const Divider(),
  68. SingleChildScrollView(
  69. child: DataTable(
  70. columnSpacing: 10,
  71. dataRowMinHeight: 40,
  72. dataRowMaxHeight: 80,
  73. columns: <DataColumn>[
  74. const DataColumn(label: Text('Cant')),
  75. const DataColumn(label: Text('Nombre')),
  76. const DataColumn(label: Text('SubTotal')),
  77. const DataColumn(label: Text('Acciones')),
  78. ],
  79. rows: <DataRow>[
  80. DataRow(selected: true, cells: <DataCell>[
  81. const DataCell(Text('1')),
  82. const DataCell(Text('Mesa 1')),
  83. const DataCell(Text('\$100.00')),
  84. DataCell(IconButton(
  85. icon: const Icon(Icons.pending_sharp),
  86. onPressed: () {}))
  87. ]),
  88. DataRow(cells: <DataCell>[
  89. const DataCell(Text('1')),
  90. const DataCell(Text(
  91. 'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
  92. const DataCell(Text("\$100.00")),
  93. DataCell(IconButton(
  94. icon: const Icon(Icons.pending_sharp),
  95. onPressed: () {}))
  96. ]),
  97. DataRow(cells: <DataCell>[
  98. const DataCell(Text('1')),
  99. const DataCell(Text(
  100. 'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
  101. const DataCell(Text("\$100.00")),
  102. DataCell(IconButton(
  103. icon: const Icon(Icons.pending_sharp),
  104. onPressed: () {}))
  105. ]),
  106. DataRow(cells: <DataCell>[
  107. const DataCell(Text('1')),
  108. const DataCell(Text(
  109. 'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
  110. const DataCell(Text("\$100.00")),
  111. DataCell(IconButton(
  112. icon: const Icon(Icons.pending_sharp),
  113. onPressed: () {}))
  114. ]),
  115. ]),
  116. ),
  117. Expanded(
  118. child: Column(
  119. children: [
  120. const Divider(),
  121. const Row(
  122. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  123. children: [
  124. Text(
  125. "Total",
  126. style: TextStyle(
  127. fontSize: 20,
  128. fontWeight: FontWeight.bold),
  129. ),
  130. Text(
  131. "\$300.00",
  132. style: TextStyle(
  133. fontSize: 20,
  134. fontWeight: FontWeight.bold),
  135. ),
  136. ],
  137. ),
  138. const SizedBox(height: 10),
  139. Row(
  140. children: [
  141. Expanded(
  142. flex: 9,
  143. child: ElevatedButton(
  144. style: const ButtonStyle(
  145. backgroundColor: MaterialStatePropertyAll(
  146. Colors.green),
  147. ),
  148. onPressed: () {},
  149. child: const Text(
  150. "Mandar a Preparacion",
  151. style: TextStyle(color: Colors.white),
  152. ),
  153. ),
  154. ),
  155. Expanded(
  156. flex: 1,
  157. child: IconButton(
  158. style: const ButtonStyle(
  159. backgroundColor:
  160. MaterialStatePropertyAll(
  161. Colors.white),
  162. iconColor: MaterialStatePropertyAll(
  163. Colors.red)),
  164. icon: const Icon(
  165. Icons.delete,
  166. color: Colors.red,
  167. ),
  168. onPressed: () {},
  169. ),
  170. ),
  171. ],
  172. )
  173. ],
  174. ),
  175. )
  176. ],
  177. ),
  178. ),
  179. ),
  180. )
  181. ],
  182. ),
  183. ),
  184. );
  185. }
  186. }
  187. class CategoryGrid extends StatelessWidget {
  188. const CategoryGrid({
  189. super.key,
  190. });
  191. @override
  192. Widget build(BuildContext context) {
  193. return Expanded(
  194. child: Container(
  195. padding: const EdgeInsets.all(8),
  196. child: GridView.builder(
  197. gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
  198. crossAxisCount: 4,
  199. crossAxisSpacing: 10,
  200. mainAxisSpacing: 15,
  201. ),
  202. itemCount: 20,
  203. itemBuilder: (context, index) {
  204. return Card(
  205. shadowColor: Colors.grey.shade700,
  206. surfaceTintColor: Colors.white,
  207. child: Column(children: [
  208. Padding(
  209. padding: const EdgeInsets.all(3),
  210. child: Container(
  211. height: 80,
  212. width: double.infinity,
  213. decoration: BoxDecoration(
  214. color: Colors.white,
  215. image: DecorationImage(
  216. image: NetworkImage(
  217. "https://picsum.photos/200/300?random=$index"),
  218. fit: BoxFit.cover,
  219. ),
  220. ),
  221. ),
  222. ),
  223. Center(
  224. child: Text(
  225. "Producto $index",
  226. style: const TextStyle(
  227. fontWeight: FontWeight.bold,
  228. fontSize: 16,
  229. color: Colors.black),
  230. ),
  231. ),
  232. const Text("Precio: \$50.00")
  233. ]),
  234. );
  235. },
  236. ),
  237. ),
  238. );
  239. }
  240. }
  241. class CategoryFilters extends StatefulWidget {
  242. const CategoryFilters({super.key});
  243. @override
  244. State<CategoryFilters> createState() => CategoryFiltersState();
  245. }
  246. class CategoryFiltersState extends State<CategoryFilters> {
  247. @override
  248. Widget build(BuildContext context) {
  249. return Container(
  250. padding: const EdgeInsets.all(8),
  251. decoration: BoxDecoration(
  252. border: Border(bottom: BorderSide(color: Colors.grey.shade300)),
  253. ),
  254. child: Row(
  255. children: [
  256. // Buscador
  257. Expanded(
  258. child: Container(
  259. height: 40,
  260. padding: const EdgeInsets.symmetric(horizontal: 12),
  261. decoration: BoxDecoration(
  262. color: Colors.grey.shade200,
  263. borderRadius: BorderRadius.circular(20),
  264. ),
  265. child: Row(
  266. children: [
  267. Icon(Icons.search, color: Colors.grey.shade600),
  268. const SizedBox(width: 8),
  269. Text('Buscar', style: TextStyle(color: Colors.grey.shade600)),
  270. ],
  271. ),
  272. ),
  273. ),
  274. const SizedBox(width: 10),
  275. // Botones de filtro
  276. _FilterButtonPLaceHolder('Categoría'),
  277. const SizedBox(width: 10),
  278. _FilterButtonPLaceHolder('Topics'),
  279. const SizedBox(width: 10),
  280. _FilterButtonPLaceHolder('Extras'),
  281. ],
  282. ),
  283. );
  284. }
  285. }
  286. Widget _FilterButtonPLaceHolder(String text) {
  287. return Container(
  288. padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
  289. decoration: BoxDecoration(
  290. color: Colors.grey.shade200,
  291. borderRadius: BorderRadius.circular(4),
  292. ),
  293. child: Text(text, style: const TextStyle(fontSize: 16)),
  294. );
  295. }