home_screen.dart 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. import 'package:flutter/material.dart';
  2. import 'package:turquessa_mesas_hoster/utils/widgets/custom_appbar.dart';
  3. import 'package:turquessa_mesas_hoster/mvvm/views/home/categorias_navbar.dart';
  4. class HomeScreen extends StatefulWidget {
  5. const HomeScreen({Key? key}) : super(key: key);
  6. @override
  7. State<HomeScreen> createState() => _HomeScreenState();
  8. }
  9. class _HomeScreenState extends State<HomeScreen> {
  10. @override
  11. void initState() {
  12. super.initState();
  13. }
  14. handleTap() {
  15. print('Tapped');
  16. }
  17. @override
  18. Widget build(BuildContext context) {
  19. return Scaffold(
  20. backgroundColor: Colors.white,
  21. body: CustomScrollView(
  22. slivers: [
  23. SliverAppBar(
  24. floating: true,
  25. expandedHeight: 200, // Ajusta la altura para acomodar la imagen
  26. flexibleSpace: FlexibleSpaceBar(
  27. background: Image.asset(
  28. 'assets/Turquessa.png',
  29. fit: BoxFit.cover,
  30. ),
  31. ),
  32. bottom: PreferredSize(
  33. preferredSize:
  34. Size.fromHeight(120), // Altura del contenido adicional
  35. child: Container(
  36. color: Color.fromARGB(255, 47, 208, 229),
  37. padding:
  38. const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
  39. child: Row(
  40. children: [
  41. Container(
  42. width: 80,
  43. height: 80,
  44. decoration: BoxDecoration(
  45. color: Colors.white,
  46. borderRadius: BorderRadius.circular(12),
  47. ),
  48. child: Center(
  49. child: Image.asset('assets/Turquessa.png'),
  50. ),
  51. ),
  52. const SizedBox(width: 20),
  53. const Text(
  54. 'Turquessa',
  55. style: TextStyle(
  56. color: Colors.black,
  57. fontSize: 26,
  58. fontWeight: FontWeight.bold,
  59. ),
  60. ),
  61. const SizedBox(width: 15),
  62. Container(
  63. padding: const EdgeInsets.all(8),
  64. decoration: BoxDecoration(
  65. shape: BoxShape.circle,
  66. border: Border.all(color: Colors.white, width: 2),
  67. ),
  68. child: const Icon(Icons.info,
  69. color: Colors.white, size: 20),
  70. ),
  71. ],
  72. ),
  73. ),
  74. ),
  75. ),
  76. SliverList(delegate: SliverChildBuilderDelegate((context, index) {
  77. return Column(
  78. children: [
  79. CategoriasNavBar(),
  80. Container(
  81. width: double.infinity,
  82. padding: const EdgeInsets.symmetric(
  83. horizontal: 20, vertical: 10),
  84. child: const Text(
  85. "Turquessa-Coffee",
  86. style: TextStyle(
  87. color: Colors.black,
  88. fontSize: 28,
  89. fontWeight: FontWeight.bold,
  90. ),
  91. ),
  92. ),
  93. _buildBurgerItem(
  94. "1. Machiatto Vainilla",
  95. "Café Colombiano selecionado, hojas selectivas frescas y Espuma de vainilla...",
  96. "MXN 115.00",
  97. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/iwf7MocBl2Kb5Wzzl7xHjPyQ99OljQH.jpg"),
  98. const Divider(color: Colors.grey, height: 1),
  99. _buildBurgerItem(
  100. "2. Cappuccino Simple",
  101. "Solo café, leche y espuma de leche",
  102. "MXN 90.00",
  103. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/qgoqrqz8pO9UBN7P412Cxtz_2n2LQy_O.jpg"),
  104. const Divider(color: Colors.grey, height: 1),
  105. _buildBurgerItem(
  106. "3. Frappé de Cajeta",
  107. "Café, leche, cajeta y hielo",
  108. "MXN 130.00",
  109. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/Z6GgNgittxZpqN7qj6ub9_sKHZxUn8i0.png"),
  110. const Divider(color: Colors.grey, height: 1),
  111. _buildBurgerItem(
  112. "1. Machiatto Vainilla",
  113. "Café Colombiano selecionado, hojas selectivas frescas y Espuma de vainilla...",
  114. "MXN 115.00",
  115. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/iwf7MocBl2Kb5Wzzl7xHjPyQ99OljQH.jpg"),
  116. const Divider(color: Colors.grey, height: 1),
  117. _buildBurgerItem(
  118. "2. Cappuccino Simple",
  119. "Solo café, leche y espuma de leche",
  120. "MXN 90.00",
  121. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/qgoqrqz8pO9UBN7P412Cxtz_2n2LQy_O.jpg"),
  122. const Divider(color: Colors.grey, height: 1),
  123. _buildBurgerItem(
  124. "3. Frappé de Cajeta",
  125. "Café, leche, cajeta y hielo",
  126. "MXN 130.00",
  127. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/Z6GgNgittxZpqN7qj6ub9_sKHZxUn8i0.png"),
  128. const Divider(color: Colors.grey, height: 1),
  129. _buildBurgerItem(
  130. "1. Machiatto Vainilla",
  131. "Café Colombiano selecionado, hojas selectivas frescas y Espuma de vainilla...",
  132. "MXN 115.00",
  133. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/iwf7MocBl2Kb5Wzzl7xHjPyQ99OljQH.jpg"),
  134. const Divider(color: Colors.grey, height: 1),
  135. _buildBurgerItem(
  136. "2. Cappuccino Simple",
  137. "Solo café, leche y espuma de leche",
  138. "MXN 90.00",
  139. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/qgoqrqz8pO9UBN7P412Cxtz_2n2LQy_O.jpg"),
  140. const Divider(color: Colors.grey, height: 1),
  141. _buildBurgerItem(
  142. "3. Frappé de Cajeta",
  143. "Café, leche, cajeta y hielo",
  144. "MXN 130.00",
  145. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/Z6GgNgittxZpqN7qj6ub9_sKHZxUn8i0.png"),
  146. _buildBurgerItem(
  147. "1. Machiatto Vainilla",
  148. "Café Colombiano selecionado, hojas selectivas frescas y Espuma de vainilla...",
  149. "MXN 115.00",
  150. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/iwf7MocBl2Kb5Wzzl7xHjPyQ99OljQH.jpg"),
  151. const Divider(color: Colors.grey, height: 1),
  152. _buildBurgerItem(
  153. "2. Cappuccino Simple",
  154. "Solo café, leche y espuma de leche",
  155. "MXN 90.00",
  156. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/qgoqrqz8pO9UBN7P412Cxtz_2n2LQy_O.jpg"),
  157. const Divider(color: Colors.grey, height: 1),
  158. _buildBurgerItem(
  159. "3. Frappé de Cajeta",
  160. "Café, leche, cajeta y hielo",
  161. "MXN 130.00",
  162. "https://pos.api.turquessacoffee.com/assets/recurso/2024/10/Z6GgNgittxZpqN7qj6ub9_sKHZxUn8i0.png"),
  163. ],
  164. );
  165. }))
  166. ],
  167. ));
  168. }
  169. }
  170. Widget _buildBurgerItem(
  171. String titulo, String descripcion, String precio, String imageUrl) {
  172. return Padding(
  173. padding: const EdgeInsets.symmetric(vertical: 20),
  174. child: Row(
  175. crossAxisAlignment: CrossAxisAlignment.start,
  176. children: [
  177. const SizedBox(width: 20),
  178. ClipRRect(
  179. borderRadius: BorderRadius.circular(8),
  180. child: Image.network(
  181. imageUrl,
  182. width: 120,
  183. height: 120,
  184. fit: BoxFit.cover,
  185. ),
  186. ),
  187. const SizedBox(width: 20),
  188. Expanded(
  189. child: Column(
  190. crossAxisAlignment: CrossAxisAlignment.start,
  191. children: [
  192. Text(
  193. titulo,
  194. style: const TextStyle(
  195. color: Colors.black,
  196. fontSize: 22,
  197. fontWeight: FontWeight.bold,
  198. ),
  199. ),
  200. const SizedBox(height: 10),
  201. Text(
  202. descripcion,
  203. style: const TextStyle(
  204. color: Colors.grey,
  205. fontSize: 16,
  206. ),
  207. ),
  208. const SizedBox(height: 20),
  209. Text(
  210. precio,
  211. style: const TextStyle(
  212. color: Colors.black,
  213. fontSize: 24,
  214. fontWeight: FontWeight.bold,
  215. ),
  216. ),
  217. ],
  218. ),
  219. ),
  220. const SizedBox(width: 20),
  221. ],
  222. ),
  223. );
  224. }