rafisbr

header_category.dart

Aug 6th, 2021 (edited)
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.20 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:provider/provider.dart';
  3. import 'package:shamo/models/user_model.dart';
  4. import 'package:shamo/providers/auth_provider.dart';
  5. import 'package:shamo/widgets/all_shoes.dart';
  6.  
  7. import '../theme.dart';
  8.  
  9. class HeaderCategory extends StatelessWidget {
  10. @override
  11. Widget build(BuildContext context) {
  12. AuthProvider authProvider = Provider.of<AuthProvider>(context);
  13. UserModel user = authProvider.user;
  14.  
  15. return Column(
  16. children: [
  17. Container(
  18. margin: EdgeInsets.only(
  19. top: defaultMargin,
  20. left: defaultMargin,
  21. right: defaultMargin,
  22. ),
  23. child: Row(
  24. children: [
  25. Expanded(
  26. child: Column(
  27. crossAxisAlignment: CrossAxisAlignment.start,
  28. children: [
  29. Text(
  30. "Hallo, ${user.name}",
  31. style: primaryTextStyle.copyWith(
  32. fontSize: 18,
  33. fontWeight: semibold,
  34. ),
  35. ),
  36. Text(
  37. '@${user.username}',
  38. style: subtitleTextStyle.copyWith(
  39. fontSize: 14,
  40. fontWeight: regular,
  41. ),
  42. ),
  43. ],
  44. ),
  45. ),
  46. Container(
  47. width: 54,
  48. height: 54,
  49. decoration: BoxDecoration(
  50. shape: BoxShape.circle,
  51. image: DecorationImage(
  52. image: NetworkImage(
  53. user.profilePhotoUrl,
  54. ),
  55. fit: BoxFit.cover,
  56. ),
  57. ),
  58. ),
  59. ],
  60. ),
  61. ),
  62. Container(
  63. margin: EdgeInsets.only(
  64. top: defaultMargin,
  65. ),
  66. child: SingleChildScrollView(
  67. scrollDirection: Axis.horizontal,
  68. child: Row(
  69. children: [
  70. SizedBox(
  71. width: defaultMargin,
  72. ),
  73. GestureDetector(
  74. onTap: () {
  75. Navigator.push(
  76. context,
  77. MaterialPageRoute(builder: (context) => AllShoes()),
  78. );
  79. },
  80. child: Container(
  81. padding: EdgeInsets.symmetric(
  82. horizontal: 12,
  83. vertical: 10,
  84. ),
  85. margin: EdgeInsets.only(right: 16),
  86. decoration: BoxDecoration(
  87. borderRadius: BorderRadius.circular(12),
  88. color: primaryColor,
  89. ),
  90. child: Text(
  91. 'All Shoes',
  92. style: primaryTextStyle.copyWith(
  93. fontSize: 13,
  94. fontWeight: medium,
  95. ),
  96. ),
  97. ),
  98. ),
  99. GestureDetector(
  100. onTap: () {},
  101. child: Container(
  102. padding: EdgeInsets.symmetric(
  103. horizontal: 12,
  104. vertical: 10,
  105. ),
  106. margin: EdgeInsets.only(right: 16),
  107. decoration: BoxDecoration(
  108. borderRadius: BorderRadius.circular(12),
  109. color: transparentColor,
  110. border: Border.all(
  111. color: subtitleColor,
  112. ),
  113. ),
  114. child: Text(
  115. 'Running',
  116. style: subtitleTextStyle.copyWith(
  117. fontSize: 13,
  118. fontWeight: medium,
  119. ),
  120. ),
  121. ),
  122. ),
  123. Container(
  124. padding: EdgeInsets.symmetric(
  125. horizontal: 12,
  126. vertical: 10,
  127. ),
  128. margin: EdgeInsets.only(right: 16),
  129. decoration: BoxDecoration(
  130. borderRadius: BorderRadius.circular(12),
  131. color: transparentColor,
  132. border: Border.all(
  133. color: subtitleColor,
  134. ),
  135. ),
  136. child: Text(
  137. 'Training',
  138. style: subtitleTextStyle.copyWith(
  139. fontSize: 13,
  140. fontWeight: medium,
  141. ),
  142. ),
  143. ),
  144. Container(
  145. padding: EdgeInsets.symmetric(
  146. horizontal: 12,
  147. vertical: 10,
  148. ),
  149. margin: EdgeInsets.only(right: 16),
  150. decoration: BoxDecoration(
  151. borderRadius: BorderRadius.circular(12),
  152. color: transparentColor,
  153. border: Border.all(
  154. color: subtitleColor,
  155. ),
  156. ),
  157. child: Text(
  158. 'Sportrs',
  159. style: subtitleTextStyle.copyWith(
  160. fontSize: 13,
  161. fontWeight: medium,
  162. ),
  163. ),
  164. ),
  165. Container(
  166. padding: EdgeInsets.symmetric(
  167. horizontal: 12,
  168. vertical: 10,
  169. ),
  170. margin: EdgeInsets.only(right: 16),
  171. decoration: BoxDecoration(
  172. borderRadius: BorderRadius.circular(12),
  173. color: transparentColor,
  174. border: Border.all(
  175. color: subtitleColor,
  176. ),
  177. ),
  178. child: Text(
  179. 'School',
  180. style: subtitleTextStyle.copyWith(
  181. fontSize: 13,
  182. fontWeight: medium,
  183. ),
  184. ),
  185. ),
  186. Container(
  187. padding: EdgeInsets.symmetric(
  188. horizontal: 12,
  189. vertical: 10,
  190. ),
  191. margin: EdgeInsets.only(right: 16),
  192. decoration: BoxDecoration(
  193. borderRadius: BorderRadius.circular(12),
  194. color: transparentColor,
  195. border: Border.all(
  196. color: subtitleColor,
  197. ),
  198. ),
  199. child: Text(
  200. 'Boots',
  201. style: subtitleTextStyle.copyWith(
  202. fontSize: 13,
  203. fontWeight: medium,
  204. ),
  205. ),
  206. ),
  207. ],
  208. ),
  209. ),
  210. ),
  211. ],
  212. );
  213. }
  214. }
  215.  
Add Comment
Please, Sign In to add comment