rewards_page.dart 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. import 'package:cpt_rewards/modules/rewards_address/rewards_address_page.dart';
  2. import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
  3. import 'package:cpt_rewards/modules/rewards_history/rewards_history_page.dart';
  4. import 'package:cpt_rewards/modules/rewards_home/rewards_home_page.dart';
  5. import 'package:cpt_rewards/modules/rewards_list/rewards_list_page.dart';
  6. import 'package:cpt_rewards/modules/rewards_my/rewards_my_page.dart';
  7. import 'package:cs_resources/generated/assets.dart';
  8. import 'package:flutter/material.dart';
  9. import 'package:auto_route/auto_route.dart';
  10. import 'package:hooks_riverpod/hooks_riverpod.dart';
  11. import 'package:plugin_platform/engine/image/image_nine_grid.dart';
  12. import 'package:router/ext/auto_router_extensions.dart';
  13. import 'package:shared/utils/color_utils.dart';
  14. import 'package:widgets/ext/ex_widget.dart';
  15. import 'package:widgets/my_load_image.dart';
  16. import '../../../router/page/rewards_page_router.dart';
  17. import './rewards_vm.dart';
  18. @RoutePage()
  19. class RewardsPage extends HookConsumerWidget {
  20. const RewardsPage({Key? key}) : super(key: key);
  21. //启动当前页面
  22. static void startInstance({BuildContext? context}) {
  23. if (context != null) {
  24. context.router.push(const RewardsPageRoute());
  25. } else {
  26. appRouter.push(const RewardsPageRoute());
  27. }
  28. }
  29. Widget _buildTop(BuildContext context, WidgetRef ref, _vm) {
  30. // List itemsList = _vm.state.list.toList();
  31. return Container(
  32. decoration: BoxDecoration(
  33. border: Border(
  34. bottom: BorderSide(
  35. color: ColorUtils.string2Color('#4161D0'), // 设置bottom边框的颜色
  36. width: 45.0, // 设置bottom边框的宽度
  37. )),
  38. borderRadius: const BorderRadius.only(
  39. topLeft: Radius.circular(0.0),
  40. topRight: Radius.circular(0.0),
  41. bottomLeft: Radius.circular(30.0),
  42. bottomRight: Radius.circular(30.0),
  43. ), // 圆角
  44. ),
  45. child: Column(
  46. crossAxisAlignment: CrossAxisAlignment.start,
  47. children: [
  48. const MyAssetImage(
  49. Assets.rewardsRewardsBack,
  50. width: 44,
  51. height: 44,
  52. ),
  53. // const Text(
  54. // '1526 Available Points',
  55. // style: TextStyle(
  56. // fontSize: 18.0,
  57. // color: Colors.white,
  58. // fontWeight: FontWeight.w500), // 设置字体大小
  59. // ).paddingOnly(left: 10, top: 20, bottom: 18),
  60. Row(
  61. crossAxisAlignment: CrossAxisAlignment.center,
  62. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  63. children: [
  64. const Text(
  65. 'Available Points',
  66. style: TextStyle(
  67. fontSize: 17.0,
  68. color: Colors.white,
  69. fontWeight: FontWeight.w500), // 设置字体大小
  70. ),
  71. Container(
  72. decoration: BoxDecoration(
  73. border: Border.all(color: Colors.white, width: 1), // 边框
  74. borderRadius: BorderRadius.circular(8), // 圆角
  75. ),
  76. child: Row(
  77. children: [
  78. const MyAssetImage(
  79. Assets.rewardsRewardsIconJb,
  80. width: 23,
  81. height: 23,
  82. ).marginOnly(right: 5),
  83. const Text(
  84. '1022',
  85. style: TextStyle(
  86. fontSize: 15.0,
  87. color: Colors.white,
  88. fontWeight: FontWeight.w400), // 设置字体大小
  89. ),
  90. ],
  91. ).paddingOnly(left: 10, top: 7, bottom: 7, right: 10),
  92. ),
  93. ],
  94. ).paddingOnly(left: 10, top: 20, bottom: 18),
  95. ],
  96. )
  97. .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
  98. .border(bottom: 0, color: ColorUtils.string2Color('#4161D0'))
  99. .backgroundColor(ColorUtils.string2Color('#4161D0')));
  100. }
  101. Widget _buildSearch(BuildContext context, WidgetRef ref, _vm) {
  102. // List itemsList = _vm.state.list.toList();
  103. return Container(
  104. width: MediaQuery.of(context).size.width - 30,
  105. decoration: BoxDecoration(
  106. color: Colors.white,
  107. borderRadius: BorderRadius.circular(10),
  108. boxShadow: const [
  109. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  110. ],
  111. ),
  112. child: Column(
  113. crossAxisAlignment: CrossAxisAlignment.start,
  114. mainAxisAlignment: MainAxisAlignment.center,
  115. children: [
  116. Text(
  117. 'Continuous Login 8 Day',
  118. style: TextStyle(
  119. fontSize: 15.0,
  120. color: ColorUtils.string2Color('#000000'),
  121. fontWeight: FontWeight.w500), // 设置字体大小
  122. ),
  123. Flex(
  124. direction: Axis.horizontal,
  125. children: [
  126. Expanded(
  127. flex: 1,
  128. child: Container(
  129. decoration: BoxDecoration(
  130. color: ColorUtils.string2Color('#F2F3F6'),
  131. borderRadius: BorderRadius.circular(10),
  132. border: Border.all(
  133. color: ColorUtils.string2Color('#4161D0'), width: 1),
  134. ),
  135. height: 78,
  136. child: Column(
  137. crossAxisAlignment: CrossAxisAlignment.center,
  138. mainAxisAlignment: MainAxisAlignment.center,
  139. children: [
  140. Text(
  141. '11/01',
  142. style: TextStyle(
  143. fontSize: 13.0,
  144. color: ColorUtils.string2Color('#4161D0'),
  145. fontWeight: FontWeight.w400), // 设置字体大小
  146. ),
  147. const MyAssetImage(
  148. Assets.rewardsRewardsIconJb,
  149. width: 23,
  150. height: 23,
  151. ),
  152. Text(
  153. '+2',
  154. style: TextStyle(
  155. fontSize: 15.0,
  156. color: ColorUtils.string2Color('#4161D0'),
  157. fontWeight: FontWeight.w500), // 设置字体大小
  158. ),
  159. ],
  160. ),
  161. ),
  162. ),
  163. const SizedBox(width: 15.0),
  164. Expanded(
  165. flex: 1,
  166. child: Container(
  167. decoration: BoxDecoration(
  168. color: ColorUtils.string2Color('#4161D0'),
  169. borderRadius: BorderRadius.circular(10),
  170. border: Border.all(
  171. color: ColorUtils.string2Color('#4161D0'), width: 1),
  172. ),
  173. height: 78,
  174. child: Column(
  175. crossAxisAlignment: CrossAxisAlignment.center,
  176. mainAxisAlignment: MainAxisAlignment.center,
  177. children: [
  178. Text(
  179. 'Today',
  180. style: TextStyle(
  181. fontSize: 13.0,
  182. color: ColorUtils.string2Color('#ffffff'),
  183. fontWeight: FontWeight.w400), // 设置字体大小
  184. ),
  185. const MyAssetImage(
  186. Assets.rewardsRewardsIconJb,
  187. width: 23,
  188. height: 23,
  189. ),
  190. Text(
  191. '+2',
  192. style: TextStyle(
  193. fontSize: 15.0,
  194. color: ColorUtils.string2Color('#ffffff'),
  195. fontWeight: FontWeight.w500), // 设置字体大小
  196. ),
  197. ],
  198. ),
  199. ),
  200. ),
  201. const SizedBox(width: 15.0),
  202. Expanded(
  203. flex: 1,
  204. child: Container(
  205. decoration: BoxDecoration(
  206. color: ColorUtils.string2Color('#F2F3F6'),
  207. borderRadius: BorderRadius.circular(10),
  208. border: Border.all(
  209. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  210. ),
  211. height: 78,
  212. child: Column(
  213. crossAxisAlignment: CrossAxisAlignment.center,
  214. mainAxisAlignment: MainAxisAlignment.center,
  215. children: [
  216. Text(
  217. 'Today',
  218. style: TextStyle(
  219. fontSize: 13.0,
  220. color: ColorUtils.string2Color('#000000'),
  221. fontWeight: FontWeight.w400), // 设置字体大小
  222. ),
  223. const MyAssetImage(
  224. Assets.rewardsRewardsIconJb,
  225. width: 23,
  226. height: 23,
  227. ),
  228. Text(
  229. '+2',
  230. style: TextStyle(
  231. fontSize: 15.0,
  232. color: ColorUtils.string2Color('#000000'),
  233. fontWeight: FontWeight.w500), // 设置字体大小
  234. ),
  235. ],
  236. ),
  237. ),
  238. ),
  239. const SizedBox(width: 15.0),
  240. Expanded(
  241. flex: 1,
  242. child: Container(
  243. decoration: BoxDecoration(
  244. color: ColorUtils.string2Color('#F2F3F6'),
  245. borderRadius: BorderRadius.circular(10),
  246. border: Border.all(
  247. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  248. ),
  249. height: 78,
  250. child: Column(
  251. crossAxisAlignment: CrossAxisAlignment.center,
  252. mainAxisAlignment: MainAxisAlignment.center,
  253. children: [
  254. Text(
  255. 'Today',
  256. style: TextStyle(
  257. fontSize: 13.0,
  258. color: ColorUtils.string2Color('#000000'),
  259. fontWeight: FontWeight.w400), // 设置字体大小
  260. ),
  261. const MyAssetImage(
  262. Assets.rewardsRewardsIconJb,
  263. width: 23,
  264. height: 23,
  265. ),
  266. Text(
  267. '+2',
  268. style: TextStyle(
  269. fontSize: 15.0,
  270. color: ColorUtils.string2Color('#000000'),
  271. fontWeight: FontWeight.w500), // 设置字体大小
  272. ),
  273. ],
  274. ),
  275. ),
  276. ),
  277. ],
  278. ).marginOnly(top: 13, bottom: 13),
  279. Flex(
  280. direction: Axis.horizontal,
  281. children: [
  282. Expanded(
  283. flex: 1,
  284. child: Container(
  285. decoration: BoxDecoration(
  286. color: ColorUtils.string2Color('#F2F3F6'),
  287. borderRadius: BorderRadius.circular(10),
  288. border: Border.all(
  289. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  290. ),
  291. height: 78,
  292. child: Column(
  293. crossAxisAlignment: CrossAxisAlignment.center,
  294. mainAxisAlignment: MainAxisAlignment.center,
  295. children: [
  296. Text(
  297. 'Today',
  298. style: TextStyle(
  299. fontSize: 13.0,
  300. color: ColorUtils.string2Color('#000000'),
  301. fontWeight: FontWeight.w400), // 设置字体大小
  302. ),
  303. const MyAssetImage(
  304. Assets.rewardsRewardsIconJb,
  305. width: 23,
  306. height: 23,
  307. ),
  308. Text(
  309. '+2',
  310. style: TextStyle(
  311. fontSize: 15.0,
  312. color: ColorUtils.string2Color('#000000'),
  313. fontWeight: FontWeight.w500), // 设置字体大小
  314. ),
  315. ],
  316. ),
  317. ),
  318. ),
  319. const SizedBox(width: 15.0),
  320. Expanded(
  321. flex: 1,
  322. child: Container(
  323. decoration: BoxDecoration(
  324. color: ColorUtils.string2Color('#F2F3F6'),
  325. borderRadius: BorderRadius.circular(10),
  326. border: Border.all(
  327. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  328. ),
  329. height: 78,
  330. child: Column(
  331. crossAxisAlignment: CrossAxisAlignment.center,
  332. mainAxisAlignment: MainAxisAlignment.center,
  333. children: [
  334. Text(
  335. 'Today',
  336. style: TextStyle(
  337. fontSize: 13.0,
  338. color: ColorUtils.string2Color('#000000'),
  339. fontWeight: FontWeight.w400), // 设置字体大小
  340. ),
  341. const MyAssetImage(
  342. Assets.rewardsRewardsIconJb,
  343. width: 23,
  344. height: 23,
  345. ),
  346. Text(
  347. '+2',
  348. style: TextStyle(
  349. fontSize: 15.0,
  350. color: ColorUtils.string2Color('#000000'),
  351. fontWeight: FontWeight.w500), // 设置字体大小
  352. ),
  353. ],
  354. ),
  355. ),
  356. ),
  357. const SizedBox(width: 15.0),
  358. Expanded(
  359. flex: 2,
  360. child: Container(
  361. decoration: BoxDecoration(
  362. color: ColorUtils.string2Color('#F2F3F6'),
  363. borderRadius: BorderRadius.circular(10),
  364. border: Border.all(
  365. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  366. ),
  367. height: 78,
  368. child: Row(
  369. crossAxisAlignment: CrossAxisAlignment.start,
  370. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  371. children: [
  372. Column(
  373. crossAxisAlignment: CrossAxisAlignment.center,
  374. // mainAxisAlignment: MainAxisAlignment.center,
  375. children: [
  376. Text(
  377. 'Today',
  378. style: TextStyle(
  379. fontSize: 13.0,
  380. color: ColorUtils.string2Color('#000000'),
  381. fontWeight: FontWeight.w400), // 设置字体大小
  382. ),
  383. Text(
  384. '+ More',
  385. style: TextStyle(
  386. fontSize: 12.0,
  387. color: ColorUtils.string2Color('#000000'),
  388. fontWeight: FontWeight.w500), // 设置字体大小
  389. ),
  390. ],
  391. ),
  392. const MyAssetImage(
  393. Assets.rewardsRewardsIconYdjb,
  394. width: 67,
  395. height: 57,
  396. ).paddingOnly(top: 7),
  397. ],
  398. ).paddingOnly(top: 8, left: 13, right: 4),
  399. ),
  400. ),
  401. ],
  402. ),
  403. ],
  404. ).paddingOnly(left: 15, right: 15, top: 15, bottom: 15),
  405. );
  406. }
  407. Widget _buildSwiper(BuildContext context, WidgetRef ref, _vm) {
  408. return Container(
  409. // color: Colors.white,
  410. height: 55,
  411. decoration: BoxDecoration(
  412. color: Colors.white,
  413. borderRadius: BorderRadius.circular(10),
  414. boxShadow: const [
  415. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  416. ],
  417. ),
  418. child: Row(
  419. crossAxisAlignment: CrossAxisAlignment.center,
  420. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  421. children: [
  422. Text(
  423. 'How To Get Rewards?',
  424. style: TextStyle(
  425. fontSize: 15.0,
  426. color: ColorUtils.string2Color('#000000'),
  427. fontWeight: FontWeight.w500), // 设置字体大小
  428. ),
  429. Container(
  430. padding:
  431. const EdgeInsets.only(top: 10, bottom: 10, left: 17, right: 17),
  432. decoration: BoxDecoration(
  433. color: ColorUtils.string2Color('#4161D0'),
  434. borderRadius: BorderRadius.circular(5),
  435. ),
  436. child: Text(
  437. 'Rewards',
  438. style: TextStyle(
  439. fontSize: 14.0,
  440. color: ColorUtils.string2Color('#ffffff'),
  441. fontWeight: FontWeight.w400), // 设置字体大小
  442. ).onTap(() {
  443. RewardsHomePage.startInstance();
  444. }),
  445. ),
  446. ],
  447. ).paddingOnly(left: 15, right: 15),
  448. ).marginOnly(top: 12, bottom: 12);
  449. }
  450. Widget _buildList(BuildContext context, WidgetRef ref, _vm) {
  451. return Container(
  452. decoration: BoxDecoration(
  453. color: Colors.white,
  454. borderRadius: BorderRadius.circular(10),
  455. boxShadow: const [
  456. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  457. ],
  458. ),
  459. child: Column(
  460. crossAxisAlignment: CrossAxisAlignment.center,
  461. mainAxisAlignment: MainAxisAlignment.center,
  462. children: [
  463. Container(
  464. padding:
  465. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  466. decoration: BoxDecoration(
  467. border: Border(
  468. bottom: BorderSide(
  469. width: 1.0, // 底边边框的宽度
  470. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  471. ))),
  472. child: Row(
  473. crossAxisAlignment: CrossAxisAlignment.center,
  474. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  475. children: [
  476. Row(
  477. children: [
  478. Container(
  479. padding: const EdgeInsets.only(
  480. top: 10, bottom: 10, left: 17, right: 17),
  481. decoration: BoxDecoration(
  482. color: ColorUtils.string2Color('#f2f3f6'),
  483. borderRadius: BorderRadius.circular(5),
  484. ),
  485. child: const MyAssetImage(
  486. Assets.rewardsRewardsIconIm,
  487. width: 29,
  488. height: 24,
  489. ),
  490. ).marginOnly(right: 12),
  491. Column(
  492. crossAxisAlignment: CrossAxisAlignment.start,
  493. mainAxisAlignment: MainAxisAlignment.center,
  494. children: [
  495. Text(
  496. 'Daily Login',
  497. style: TextStyle(
  498. fontSize: 15.0,
  499. color: ColorUtils.string2Color('#000000'),
  500. fontWeight: FontWeight.w500), // 设置字体大小
  501. ).marginOnly(bottom: 6),
  502. Row(
  503. children: [
  504. Text(
  505. '+2',
  506. style: TextStyle(
  507. fontSize: 15.0,
  508. color: ColorUtils.string2Color('#4161D0'),
  509. fontWeight: FontWeight.w500), // 设置字体大小
  510. ),
  511. const MyAssetImage(
  512. Assets.rewardsRewardsIconJb,
  513. width: 14,
  514. height: 14,
  515. )
  516. ],
  517. )
  518. ],
  519. )
  520. ],
  521. ),
  522. Container(
  523. width: 86,
  524. height: 30,
  525. decoration: BoxDecoration(
  526. color: ColorUtils.string2Color('#ffffff'),
  527. borderRadius: BorderRadius.circular(5),
  528. border: Border.all(
  529. color: ColorUtils.string2Color('#4161D0'), width: 1),
  530. ),
  531. child: Center(
  532. child: Text(
  533. 'Check In',
  534. style: TextStyle(
  535. fontSize: 14.0,
  536. color: ColorUtils.string2Color('#4161D0'),
  537. fontWeight: FontWeight.w400), // 设置字体大小
  538. ),
  539. ),
  540. ),
  541. ],
  542. ),
  543. ),
  544. Container(
  545. padding:
  546. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  547. decoration: BoxDecoration(
  548. border: Border(
  549. bottom: BorderSide(
  550. width: 1.0, // 底边边框的宽度
  551. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  552. ))),
  553. child: Row(
  554. crossAxisAlignment: CrossAxisAlignment.center,
  555. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  556. children: [
  557. Row(
  558. children: [
  559. Container(
  560. padding: const EdgeInsets.only(
  561. top: 10, bottom: 10, left: 17, right: 17),
  562. decoration: BoxDecoration(
  563. color: ColorUtils.string2Color('#f2f3f6'),
  564. borderRadius: BorderRadius.circular(5),
  565. ),
  566. child: const MyAssetImage(
  567. Assets.rewardsRewardsIconIm,
  568. width: 29,
  569. height: 24,
  570. ),
  571. ).marginOnly(right: 12),
  572. Column(
  573. crossAxisAlignment: CrossAxisAlignment.start,
  574. mainAxisAlignment: MainAxisAlignment.center,
  575. children: [
  576. Text(
  577. 'Daily Login',
  578. style: TextStyle(
  579. fontSize: 15.0,
  580. color: ColorUtils.string2Color('#000000'),
  581. fontWeight: FontWeight.w500), // 设置字体大小
  582. ).marginOnly(bottom: 6),
  583. Row(
  584. children: [
  585. Text(
  586. '+2',
  587. style: TextStyle(
  588. fontSize: 15.0,
  589. color: ColorUtils.string2Color('#4161D0'),
  590. fontWeight: FontWeight.w500), // 设置字体大小
  591. ),
  592. const MyAssetImage(
  593. Assets.rewardsRewardsIconJb,
  594. width: 14,
  595. height: 14,
  596. )
  597. ],
  598. )
  599. ],
  600. )
  601. ],
  602. ),
  603. Container(
  604. width: 86,
  605. height: 30,
  606. decoration: BoxDecoration(
  607. color: ColorUtils.string2Color('#ffffff'),
  608. borderRadius: BorderRadius.circular(5),
  609. border: Border.all(
  610. color: ColorUtils.string2Color('#4161D0'), width: 1),
  611. ),
  612. child: Center(
  613. child: Text(
  614. 'Check In',
  615. style: TextStyle(
  616. fontSize: 14.0,
  617. color: ColorUtils.string2Color('#4161D0'),
  618. fontWeight: FontWeight.w400), // 设置字体大小
  619. ),
  620. ),
  621. ),
  622. ],
  623. ),
  624. ),
  625. Container(
  626. padding:
  627. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  628. decoration: BoxDecoration(
  629. border: Border(
  630. bottom: BorderSide(
  631. width: 1.0, // 底边边框的宽度
  632. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  633. ))),
  634. child: Row(
  635. crossAxisAlignment: CrossAxisAlignment.center,
  636. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  637. children: [
  638. Row(
  639. children: [
  640. Container(
  641. padding: const EdgeInsets.only(
  642. top: 10, bottom: 10, left: 17, right: 17),
  643. decoration: BoxDecoration(
  644. color: ColorUtils.string2Color('#f2f3f6'),
  645. borderRadius: BorderRadius.circular(5),
  646. ),
  647. child: const MyAssetImage(
  648. Assets.rewardsRewardsIconIm,
  649. width: 29,
  650. height: 24,
  651. ),
  652. ).marginOnly(right: 12),
  653. Column(
  654. crossAxisAlignment: CrossAxisAlignment.start,
  655. mainAxisAlignment: MainAxisAlignment.center,
  656. children: [
  657. Text(
  658. 'Daily Login',
  659. style: TextStyle(
  660. fontSize: 15.0,
  661. color: ColorUtils.string2Color('#000000'),
  662. fontWeight: FontWeight.w500), // 设置字体大小
  663. ).marginOnly(bottom: 6),
  664. Row(
  665. children: [
  666. Text(
  667. '+2',
  668. style: TextStyle(
  669. fontSize: 15.0,
  670. color: ColorUtils.string2Color('#4161D0'),
  671. fontWeight: FontWeight.w500), // 设置字体大小
  672. ),
  673. const MyAssetImage(
  674. Assets.rewardsRewardsIconJb,
  675. width: 14,
  676. height: 14,
  677. )
  678. ],
  679. )
  680. ],
  681. )
  682. ],
  683. ),
  684. Container(
  685. width: 86,
  686. height: 30,
  687. decoration: BoxDecoration(
  688. color: ColorUtils.string2Color('#ffffff'),
  689. borderRadius: BorderRadius.circular(5),
  690. border: Border.all(
  691. color: ColorUtils.string2Color('#4161D0'), width: 1),
  692. ),
  693. child: Center(
  694. child: Text(
  695. 'Check In',
  696. style: TextStyle(
  697. fontSize: 14.0,
  698. color: ColorUtils.string2Color('#4161D0'),
  699. fontWeight: FontWeight.w400), // 设置字体大小
  700. ),
  701. ),
  702. ),
  703. ],
  704. ),
  705. )
  706. ],
  707. ),
  708. ).marginOnly(bottom: 12);
  709. }
  710. Widget _buildHistory(BuildContext context, WidgetRef ref, _vm) {
  711. return Container(
  712. decoration: BoxDecoration(
  713. color: Colors.white,
  714. borderRadius: BorderRadius.circular(10),
  715. boxShadow: const [
  716. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  717. ],
  718. ),
  719. child: Column(
  720. crossAxisAlignment: CrossAxisAlignment.center,
  721. mainAxisAlignment: MainAxisAlignment.center,
  722. children: [
  723. Row(
  724. crossAxisAlignment: CrossAxisAlignment.center,
  725. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  726. children: [
  727. Text(
  728. 'Points History',
  729. style: TextStyle(
  730. fontSize: 15.0,
  731. color: ColorUtils.string2Color('#000000'),
  732. fontWeight: FontWeight.w500), // 设置字体大小
  733. ),
  734. Text(
  735. 'More >',
  736. style: TextStyle(
  737. fontSize: 15.0,
  738. color: ColorUtils.string2Color('#4161D0'),
  739. fontWeight: FontWeight.w500), // 设置字体大小
  740. ).onTap(() {
  741. RewardsHistoryPage.startInstance();
  742. })
  743. ]).paddingOnly(left: 15, right: 15, top: 15, bottom: 5),
  744. Container(
  745. padding:
  746. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  747. decoration: BoxDecoration(
  748. border: Border(
  749. bottom: BorderSide(
  750. width: 1.0, // 底边边框的宽度
  751. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  752. ))),
  753. child: Row(
  754. crossAxisAlignment: CrossAxisAlignment.center,
  755. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  756. children: [
  757. Column(
  758. crossAxisAlignment: CrossAxisAlignment.start,
  759. mainAxisAlignment: MainAxisAlignment.center,
  760. children: [
  761. Text(
  762. 'Daily Login',
  763. style: TextStyle(
  764. fontSize: 15.0,
  765. color: ColorUtils.string2Color('#000000'),
  766. fontWeight: FontWeight.w500), // 设置字体大小
  767. ).marginOnly(bottom: 6),
  768. Text(
  769. '14 Oct 2024 10:00PM',
  770. style: TextStyle(
  771. fontSize: 13.0,
  772. color: ColorUtils.string2Color('#808DAF'),
  773. fontWeight: FontWeight.w400), // 设置字体大小
  774. ),
  775. ],
  776. ),
  777. Text(
  778. '+2',
  779. style: TextStyle(
  780. fontSize: 20.0,
  781. color: ColorUtils.string2Color('#FDB429'),
  782. fontWeight: FontWeight.w500), // 设置字体大小
  783. ),
  784. ],
  785. ),
  786. ),
  787. Container(
  788. padding:
  789. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  790. decoration: BoxDecoration(
  791. border: Border(
  792. bottom: BorderSide(
  793. width: 1.0, // 底边边框的宽度
  794. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  795. ))),
  796. child: Row(
  797. crossAxisAlignment: CrossAxisAlignment.center,
  798. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  799. children: [
  800. Column(
  801. crossAxisAlignment: CrossAxisAlignment.start,
  802. mainAxisAlignment: MainAxisAlignment.center,
  803. children: [
  804. Text(
  805. 'Daily Login',
  806. style: TextStyle(
  807. fontSize: 15.0,
  808. color: ColorUtils.string2Color('#000000'),
  809. fontWeight: FontWeight.w500), // 设置字体大小
  810. ).marginOnly(bottom: 6),
  811. Text(
  812. '14 Oct 2024 10:00PM',
  813. style: TextStyle(
  814. fontSize: 13.0,
  815. color: ColorUtils.string2Color('#808DAF'),
  816. fontWeight: FontWeight.w400), // 设置字体大小
  817. ),
  818. ],
  819. ),
  820. Text(
  821. '+2',
  822. style: TextStyle(
  823. fontSize: 20.0,
  824. color: ColorUtils.string2Color('#FDB429'),
  825. fontWeight: FontWeight.w500), // 设置字体大小
  826. ),
  827. ],
  828. ),
  829. ),
  830. Container(
  831. padding:
  832. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  833. decoration: BoxDecoration(
  834. border: Border(
  835. bottom: BorderSide(
  836. width: 1.0, // 底边边框的宽度
  837. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  838. ))),
  839. child: Row(
  840. crossAxisAlignment: CrossAxisAlignment.center,
  841. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  842. children: [
  843. Column(
  844. crossAxisAlignment: CrossAxisAlignment.start,
  845. mainAxisAlignment: MainAxisAlignment.center,
  846. children: [
  847. Text(
  848. 'Daily Login',
  849. style: TextStyle(
  850. fontSize: 15.0,
  851. color: ColorUtils.string2Color('#000000'),
  852. fontWeight: FontWeight.w500), // 设置字体大小
  853. ).marginOnly(bottom: 6),
  854. Text(
  855. '14 Oct 2024 10:00PM',
  856. style: TextStyle(
  857. fontSize: 13.0,
  858. color: ColorUtils.string2Color('#808DAF'),
  859. fontWeight: FontWeight.w400), // 设置字体大小
  860. ),
  861. ],
  862. ),
  863. Text(
  864. '+2',
  865. style: TextStyle(
  866. fontSize: 20.0,
  867. color: ColorUtils.string2Color('#FDB429'),
  868. fontWeight: FontWeight.w500), // 设置字体大小
  869. ),
  870. ],
  871. ),
  872. ),
  873. ],
  874. ),
  875. ).marginOnly(bottom: 12);
  876. }
  877. @override
  878. Widget build(BuildContext context, WidgetRef ref) {
  879. final _vm = ref.read(rewardsVmProvider.notifier);
  880. return Scaffold(
  881. // appBar: AppBar(title: Text("奖励")),
  882. body: Column(children: [
  883. Expanded(
  884. child: SingleChildScrollView(
  885. scrollDirection: Axis.vertical,
  886. physics: const BouncingScrollPhysics(),
  887. clipBehavior: Clip.none,
  888. child: Column(
  889. children: [
  890. _buildTop(context, ref, _vm),
  891. Container(
  892. transform: Matrix4.translationValues(0.0, -45.0, 0.0),
  893. child: Column(
  894. children: [
  895. _buildSearch(context, ref, _vm),
  896. _buildSwiper(context, ref, _vm),
  897. _buildList(context, ref, _vm),
  898. _buildHistory(context, ref, _vm),
  899. ],
  900. ), // 使用负数margin
  901. ).paddingOnly(left: 15, right: 15),
  902. ],
  903. )),
  904. ),
  905. ]).backgroundColor(ColorUtils.string2Color('#F2F3F6')),
  906. );
  907. }
  908. }