rewards_detail_page.dart 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. import 'package:cpt_rewards/modules/rewards_confirm/rewards_confirm_page.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. import 'package:cs_resources/theme/app_colors_theme.dart';
  4. import 'package:domain/entity/rewards_detail_entity.dart';
  5. import 'package:flutter/cupertino.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:auto_route/auto_route.dart';
  8. import 'package:flutter_hooks/flutter_hooks.dart';
  9. import 'package:hooks_riverpod/hooks_riverpod.dart';
  10. import 'package:router/ext/auto_router_extensions.dart';
  11. import 'package:shared/utils/date_time_utils.dart';
  12. import 'package:shared/utils/log_utils.dart';
  13. import 'package:shared/utils/color_utils.dart';
  14. import 'package:widgets/ext/ex_widget.dart';
  15. import 'package:widgets/load_state_layout.dart';
  16. import 'package:widgets/my_appbar.dart';
  17. import 'package:widgets/my_load_image.dart';
  18. import 'package:widgets/my_text_view.dart';
  19. import 'package:widgets/shatter/picker_container.dart';
  20. import 'package:widgets/utils/dark_theme_util.dart';
  21. import 'package:widgets/widget_export.dart';
  22. import 'package:cs_resources/generated/assets.dart';
  23. import '../../../router/page/rewards_page_router.dart';
  24. import './rewards_detail_vm.dart';
  25. @RoutePage()
  26. class RewardsDetailPage extends HookConsumerWidget {
  27. final int? id;
  28. const RewardsDetailPage({Key? key, @PathParam('id') required this.id})
  29. : super(key: key);
  30. //启动当前页面
  31. static void startInstance({
  32. BuildContext? context,
  33. int? id,
  34. }) {
  35. if (context != null) {
  36. context.router.push(RewardsDetailPageRoute(id: id));
  37. } else {
  38. appRouter.push(RewardsDetailPageRoute(id: id));
  39. }
  40. }
  41. // listitem
  42. Widget _buildSaleItem(BuildContext context, WidgetRef ref, _vm, detailInfo) {
  43. String title = detailInfo!.title ?? "";
  44. String createdAt = detailInfo.createdAt ?? "";
  45. List? resources = detailInfo!.resources ?? [];
  46. int point = detailInfo.point ?? 0;
  47. int originalPoint = detailInfo.originalPoint ?? 0;
  48. String description = detailInfo.description ?? "";
  49. bool reservation = detailInfo!.reservation;
  50. String redeemedStart = detailInfo.redeemedStart ?? "";
  51. String redeemedEnd = detailInfo.redeemedEnd ?? "";
  52. String redeemedDate = '$redeemedStart-$redeemedEnd';
  53. String? createAt = '${redeemedStart.split(" at ")[0]} ${redeemedStart.split(" at ")[1]}';
  54. String? createEnd =
  55. '${redeemedEnd.split(" at ")[0]} ${redeemedEnd.split(" at ")[1]}';
  56. String cretaeDate = '$createAt-$createEnd';
  57. return Column(
  58. children: [
  59. Container(
  60. decoration: BoxDecoration(
  61. color: context.appColors.whiteBG,
  62. borderRadius: BorderRadius.all(Radius.circular(6.0)),
  63. boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
  64. ),
  65. width: MediaQuery.of(context).size.width - 30,
  66. // height: 420,
  67. // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
  68. child: Column(
  69. children: [
  70. resources!.length > 0
  71. ? MyLoadImage(
  72. resources[0] ?? '',
  73. width: MediaQuery.of(context).size.width,
  74. height: 150,
  75. )
  76. : Container(),
  77. Column(
  78. crossAxisAlignment: CrossAxisAlignment.start,
  79. mainAxisAlignment: MainAxisAlignment.start,
  80. children: [
  81. Text(
  82. maxLines: 1, // 设置最大行数为2
  83. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  84. title,
  85. style: TextStyle(
  86. fontSize: 16.0,
  87. color: context.appColors.textBlack,
  88. fontWeight: FontWeight.w500),
  89. ),
  90. Text(
  91. maxLines: 1, // 设置最大行数为2
  92. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  93. '${S.current.published_date}: $createdAt',
  94. style: TextStyle(
  95. fontSize: 13.0,
  96. color: DarkThemeUtil.multiColors(
  97. context, ColorUtils.string2Color('#808DAF'),
  98. darkColor: Colors.white),
  99. fontWeight: FontWeight.w400),
  100. ).marginOnly(bottom: 5),
  101. Row(
  102. children: [
  103. Text(
  104. '$point',
  105. style: TextStyle(
  106. fontSize: 19.0,
  107. color: context.appColors.textBlack,
  108. fontWeight: FontWeight.w500),
  109. ),
  110. Text(
  111. '$originalPoint',
  112. style: TextStyle(
  113. decoration: TextDecoration.lineThrough,
  114. decorationColor: DarkThemeUtil.multiColors(
  115. context, ColorUtils.string2Color('#808DAF'),
  116. darkColor: Colors.white),
  117. decorationStyle: TextDecorationStyle.solid,
  118. fontSize: 12.0,
  119. color: ColorUtils.string2Color('#808DAF'),
  120. fontWeight: FontWeight.w400),
  121. ).marginOnly(left: 5, right: 5),
  122. Text(
  123. S.current.points,
  124. style: TextStyle(
  125. fontSize: 13.0,
  126. color: context.appColors.textBlack,
  127. fontWeight: FontWeight.w400),
  128. ),
  129. ],
  130. ),
  131. Text(
  132. description,
  133. style: TextStyle(
  134. fontSize: 13.0,
  135. color: DarkThemeUtil.multiColors(
  136. context, ColorUtils.string2Color('#808DAF'),
  137. darkColor: Colors.white),
  138. fontWeight: FontWeight.w400),
  139. ).marginOnly(bottom: 10, top: 10),
  140. Container(
  141. height: 28,
  142. decoration: BoxDecoration(
  143. color: ColorUtils.string2Color('#F2F3F6'),
  144. borderRadius:
  145. const BorderRadius.all(Radius.circular(6.0)),
  146. ),
  147. child: Column(
  148. children: [
  149. Row(
  150. mainAxisSize: MainAxisSize.min,
  151. mainAxisAlignment: MainAxisAlignment.start,
  152. crossAxisAlignment: CrossAxisAlignment.center,
  153. children: [
  154. MyAssetImage(
  155. Assets.rewardsRewardsDetailDay,
  156. width: 25,
  157. height: 25,
  158. color: DarkThemeUtil.multiColors(
  159. context, AppColorsTheme.colorPrimary,
  160. darkColor: Colors.white),
  161. ),
  162. Text(
  163. maxLines: 1, // 设置最大行数为2
  164. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  165. '$cretaeDate',
  166. style: TextStyle(
  167. fontSize: 14.0,
  168. color: ColorUtils.string2Color('#808DAF'),
  169. fontWeight: FontWeight.w400),
  170. )
  171. ],
  172. ).paddingOnly(left: 7, right: 12),
  173. // Text(
  174. // maxLines: 1, // 设置最大行数为2
  175. // overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  176. // '|',
  177. // style: TextStyle(
  178. // fontSize: 14.0,
  179. // color: ColorUtils.string2Color('#808DAF'),
  180. // fontWeight: FontWeight.w400),
  181. // ),
  182. // Text(
  183. // maxLines: 1, // 设置最大行数为2
  184. // overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  185. // '$redeemedEnd',
  186. // style: TextStyle(
  187. // fontSize: 14.0,
  188. // color: ColorUtils.string2Color('#808DAF'),
  189. // fontWeight: FontWeight.w400),
  190. // ).marginOnly(left: 30)
  191. ],
  192. )),
  193. Container(
  194. height: 28,
  195. decoration: BoxDecoration(
  196. color: ColorUtils.string2Color('#F2F3F6'),
  197. borderRadius:
  198. const BorderRadius.all(Radius.circular(6.0)),
  199. ),
  200. child: Row(
  201. mainAxisSize: MainAxisSize.min,
  202. mainAxisAlignment: MainAxisAlignment.start,
  203. crossAxisAlignment: CrossAxisAlignment.center,
  204. children: [
  205. MyAssetImage(
  206. Assets.rewardsRewardsDetailRequired,
  207. width: 25,
  208. height: 25,
  209. color: DarkThemeUtil.multiColors(
  210. context, AppColorsTheme.colorPrimary,
  211. darkColor: Colors.white),
  212. ),
  213. Text(
  214. maxLines: 1, // 设置最大行数为2
  215. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  216. reservation
  217. ? S.current.reservation_required
  218. : S.current.no_reservation_required,
  219. style: TextStyle(
  220. fontSize: 14.0,
  221. color: ColorUtils.string2Color('#808DAF'),
  222. fontWeight: FontWeight.w400),
  223. )
  224. ],
  225. ).paddingOnly(left: 7, right: 12))
  226. .marginOnly(top: 8, bottom: 25)
  227. ],
  228. ).paddingOnly(left: 15, right: 15, top: 10),
  229. ],
  230. )),
  231. ],
  232. ).marginOnly(left: 15, bottom: 15, right: 15);
  233. }
  234. Widget _buildDeal(BuildContext context, WidgetRef ref, _vm) {
  235. return Column(
  236. children: [
  237. Container(
  238. decoration: const BoxDecoration(
  239. color: Colors.white,
  240. borderRadius: BorderRadius.all(Radius.circular(6.0)),
  241. boxShadow: [
  242. BoxShadow(
  243. color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  244. ],
  245. ),
  246. width: MediaQuery.of(context).size.width - 30,
  247. child: Column(
  248. crossAxisAlignment: CrossAxisAlignment.start,
  249. children: [
  250. Row(
  251. mainAxisSize: MainAxisSize.min,
  252. mainAxisAlignment: MainAxisAlignment.start,
  253. crossAxisAlignment: CrossAxisAlignment.center,
  254. children: [
  255. MyAssetImage(
  256. Assets.rewardsRewardsDetailDeal,
  257. width: 25,
  258. height: 25,
  259. color: DarkThemeUtil.multiColors(
  260. context, AppColorsTheme.colorPrimary,
  261. darkColor: Colors.white),
  262. ).marginOnly(right: 10),
  263. Text(
  264. S.current.redeem_deal_at,
  265. style: TextStyle(
  266. fontSize: 15.0,
  267. color: context.appColors.textBlack,
  268. fontWeight: FontWeight.w500),
  269. )
  270. ],
  271. ),
  272. Container(
  273. height: 77,
  274. decoration: BoxDecoration(
  275. color: DarkThemeUtil.multiColors(
  276. context, ColorUtils.string2Color('#F2F3F6'),
  277. darkColor: Colors.white),
  278. borderRadius:
  279. const BorderRadius.all(Radius.circular(6.0)),
  280. ),
  281. child: Row(
  282. mainAxisSize: MainAxisSize.max,
  283. mainAxisAlignment: MainAxisAlignment.start,
  284. crossAxisAlignment: CrossAxisAlignment.center,
  285. children: [
  286. MyAssetImage(
  287. Assets.rewardsRewardsIndex1,
  288. width: 60,
  289. height: 60,
  290. color: DarkThemeUtil.multiColors(
  291. context, AppColorsTheme.colorPrimary,
  292. darkColor: Colors.white),
  293. ).marginOnly(right: 15),
  294. Column(
  295. crossAxisAlignment: CrossAxisAlignment.start,
  296. children: [
  297. Text(
  298. maxLines: 1, // 设置最大行数为2
  299. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  300. 'Delibowl Group',
  301. style: TextStyle(
  302. fontSize: 15.0,
  303. color: DarkThemeUtil.multiColors(context,
  304. ColorUtils.string2Color('#54638C'),
  305. darkColor: Colors.white),
  306. fontWeight: FontWeight.w500),
  307. ).marginOnly(bottom: 8),
  308. Text(
  309. maxLines: 1, // 设置最大行数为2
  310. overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
  311. '#01-136, SingPost Center, 408600',
  312. style: TextStyle(
  313. fontSize: 14.0,
  314. color: DarkThemeUtil.multiColors(context,
  315. ColorUtils.string2Color('#54638C'),
  316. darkColor: Colors.white),
  317. fontWeight: FontWeight.w400),
  318. )
  319. ],
  320. ).paddingOnly(
  321. top: 5,
  322. )
  323. ],
  324. ).paddingOnly(left: 12, right: 12, bottom: 9, top: 9))
  325. .marginOnly(top: 12, bottom: 12),
  326. Row(
  327. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  328. crossAxisAlignment: CrossAxisAlignment.center,
  329. children: [
  330. Text(
  331. 'Also redeemable in 1 more location',
  332. style: TextStyle(
  333. fontSize: 15.0,
  334. color: DarkThemeUtil.multiColors(
  335. context, ColorUtils.string2Color('#54638C'),
  336. darkColor: Colors.white),
  337. fontWeight: FontWeight.w400),
  338. ),
  339. MyAssetImage(
  340. Assets.rewardsRewardsRight,
  341. width: 12,
  342. height: 16,
  343. color: DarkThemeUtil.multiColors(
  344. context, AppColorsTheme.colorPrimary,
  345. darkColor: Colors.white),
  346. ),
  347. ],
  348. ),
  349. ],
  350. ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
  351. ),
  352. ],
  353. ).marginOnly(left: 15, bottom: 15, right: 15);
  354. }
  355. Widget _buildPackage(BuildContext context, WidgetRef ref, _vm, detailInfo) {
  356. String package = detailInfo.package ?? "";
  357. return Column(
  358. children: [
  359. Container(
  360. decoration: BoxDecoration(
  361. color: context.appColors.whiteBG,
  362. borderRadius: const BorderRadius.all(Radius.circular(6.0)),
  363. boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
  364. ),
  365. width: MediaQuery.of(context).size.width - 30,
  366. child: Column(
  367. crossAxisAlignment: CrossAxisAlignment.start,
  368. children: [
  369. Row(
  370. mainAxisSize: MainAxisSize.min,
  371. mainAxisAlignment: MainAxisAlignment.start,
  372. crossAxisAlignment: CrossAxisAlignment.center,
  373. children: [
  374. MyAssetImage(
  375. Assets.rewardsRewardsDetailPackage,
  376. width: 25,
  377. height: 25,
  378. color: DarkThemeUtil.multiColors(
  379. context, AppColorsTheme.colorPrimary,
  380. darkColor: Colors.white),
  381. ).marginOnly(right: 10),
  382. Text(
  383. 'What’s In The Package',
  384. style: TextStyle(
  385. fontSize: 15.0,
  386. color: context.appColors.textBlack,
  387. fontWeight: FontWeight.w500),
  388. )
  389. ],
  390. ).marginOnly(bottom: 10),
  391. Column(
  392. crossAxisAlignment: CrossAxisAlignment.start,
  393. children: [
  394. Text(
  395. package,
  396. style: TextStyle(
  397. fontSize: 15.0,
  398. color: DarkThemeUtil.multiColors(
  399. context, ColorUtils.string2Color('#54638C'),
  400. darkColor: Colors.white),
  401. fontWeight: FontWeight.w400),
  402. ),
  403. ],
  404. ),
  405. ],
  406. ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
  407. ),
  408. ],
  409. ).marginOnly(left: 15, bottom: 15, right: 15);
  410. }
  411. Widget _buildNotice(BuildContext context, WidgetRef ref, _vm, detailInfo) {
  412. String notice = detailInfo.notice ?? "";
  413. return Column(
  414. children: [
  415. Container(
  416. decoration: BoxDecoration(
  417. color: context.appColors.whiteBG,
  418. borderRadius: const BorderRadius.all(Radius.circular(6.0)),
  419. boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
  420. ),
  421. width: MediaQuery.of(context).size.width - 30,
  422. child: Column(
  423. crossAxisAlignment: CrossAxisAlignment.start,
  424. children: [
  425. Row(
  426. mainAxisSize: MainAxisSize.min,
  427. mainAxisAlignment: MainAxisAlignment.start,
  428. crossAxisAlignment: CrossAxisAlignment.center,
  429. children: [
  430. MyAssetImage(
  431. Assets.rewardsRewardsDetailNotice,
  432. width: 25,
  433. height: 25,
  434. color: DarkThemeUtil.multiColors(
  435. context, AppColorsTheme.colorPrimary,
  436. darkColor: Colors.white),
  437. ).marginOnly(right: 10),
  438. Text(
  439. S.current.redemption_notice,
  440. style: TextStyle(
  441. fontSize: 15.0,
  442. color: context.appColors.textBlack,
  443. fontWeight: FontWeight.w500),
  444. )
  445. ],
  446. ).marginOnly(bottom: 10),
  447. Column(
  448. crossAxisAlignment: CrossAxisAlignment.start,
  449. children: [
  450. Text(
  451. notice,
  452. style: TextStyle(
  453. fontSize: 15.0,
  454. color: DarkThemeUtil.multiColors(
  455. context, ColorUtils.string2Color('#54638C'),
  456. darkColor: Colors.white),
  457. fontWeight: FontWeight.w400),
  458. ),
  459. ],
  460. ),
  461. ],
  462. ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
  463. ),
  464. ],
  465. ).marginOnly(left: 15, bottom: 15, right: 15);
  466. }
  467. Widget _buildInstructions(BuildContext context, WidgetRef ref, _vm) {
  468. return Column(
  469. children: [
  470. Container(
  471. decoration: BoxDecoration(
  472. color: context.appColors.whiteBG,
  473. borderRadius: BorderRadius.all(Radius.circular(6.0)),
  474. boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
  475. ),
  476. width: MediaQuery.of(context).size.width - 30,
  477. child: Column(
  478. crossAxisAlignment: CrossAxisAlignment.start,
  479. children: [
  480. Row(
  481. mainAxisSize: MainAxisSize.min,
  482. mainAxisAlignment: MainAxisAlignment.start,
  483. crossAxisAlignment: CrossAxisAlignment.center,
  484. children: [
  485. MyAssetImage(
  486. Assets.rewardsRewardsDetailInstructions,
  487. width: 25,
  488. height: 25,
  489. color: DarkThemeUtil.multiColors(
  490. context, AppColorsTheme.colorPrimary,
  491. darkColor: Colors.white),
  492. ).marginOnly(right: 10),
  493. Text(
  494. S.current.redemption_instructions,
  495. style: TextStyle(
  496. fontSize: 15.0,
  497. color: context.appColors.textBlack,
  498. fontWeight: FontWeight.w500),
  499. )
  500. ],
  501. ).marginOnly(bottom: 10),
  502. Column(
  503. crossAxisAlignment: CrossAxisAlignment.start,
  504. children: [
  505. Text(
  506. S.current.redemption_reservation_txt,
  507. style: TextStyle(
  508. fontSize: 15.0,
  509. color: DarkThemeUtil.multiColors(
  510. context, ColorUtils.string2Color('#54638C'),
  511. darkColor: Colors.white),
  512. fontWeight: FontWeight.w400),
  513. ),
  514. ],
  515. ),
  516. ],
  517. ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
  518. ),
  519. ],
  520. ).marginOnly(left: 15, bottom: 15, right: 15);
  521. }
  522. Widget _buildRedeemable(
  523. BuildContext context, WidgetRef ref, _vm, detailInfo) {
  524. List? redeemable = detailInfo!.redeemable ?? [];
  525. return Column(
  526. children: [
  527. Container(
  528. decoration: BoxDecoration(
  529. color: context.appColors.whiteBG,
  530. borderRadius: const BorderRadius.all(Radius.circular(6.0)),
  531. boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
  532. ),
  533. width: MediaQuery.of(context).size.width - 30,
  534. child: Column(
  535. crossAxisAlignment: CrossAxisAlignment.start,
  536. children: [
  537. Row(
  538. mainAxisSize: MainAxisSize.min,
  539. mainAxisAlignment: MainAxisAlignment.start,
  540. crossAxisAlignment: CrossAxisAlignment.center,
  541. children: [
  542. MyAssetImage(
  543. Assets.rewardsRewardsDetailNotice,
  544. width: 25,
  545. height: 25,
  546. color: DarkThemeUtil.multiColors(
  547. context, AppColorsTheme.colorPrimary,
  548. darkColor: Colors.white),
  549. ).marginOnly(right: 10),
  550. Text(
  551. S.current.redeemable_on,
  552. style: TextStyle(
  553. fontSize: 15.0,
  554. color: context.appColors.textBlack,
  555. fontWeight: FontWeight.w500),
  556. )
  557. ],
  558. ).marginOnly(bottom: 10),
  559. Column(
  560. crossAxisAlignment: CrossAxisAlignment.start,
  561. children: List.generate(
  562. redeemable!.length,
  563. (index) {
  564. final item = redeemable[index];
  565. return Text(
  566. '${item.day}: ${item.time}',
  567. style: TextStyle(
  568. fontSize: 15.0,
  569. color: DarkThemeUtil.multiColors(
  570. context, ColorUtils.string2Color('#54638C'),
  571. darkColor: Colors.white),
  572. fontWeight: FontWeight.w400),
  573. );
  574. },
  575. ),
  576. ),
  577. ],
  578. ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
  579. ),
  580. ],
  581. ).marginOnly(left: 15, bottom: 15, right: 15);
  582. }
  583. @override
  584. Widget build(BuildContext context, WidgetRef ref) {
  585. final _vm = ref.read(rewardsDetailVmProvider.notifier);
  586. final state = ref.watch(rewardsDetailVmProvider);
  587. RewardsDetailEntity? detailInfo = state.detailInfo;
  588. useEffect(() {
  589. // 组件挂载时执行 - 执行接口请求
  590. Future.microtask(() => _vm.initPageData(id: id));
  591. return () {
  592. // 组件卸载时执行
  593. Log.d("property_news_page 组件卸载时执行");
  594. };
  595. }, []);
  596. return Scaffold(
  597. appBar: MyAppBar.appBar(
  598. context,
  599. S.current.detail,
  600. backgroundColor: context.appColors.whiteBG,
  601. ),
  602. body: LoadStateLayout(
  603. state: state.loadingState,
  604. errorMessage: state.errorMessage,
  605. errorRetry: () {
  606. _vm.retryRequest(id: id);
  607. },
  608. successWidget: Column(
  609. children: [
  610. Expanded(
  611. child: SingleChildScrollView(
  612. scrollDirection: Axis.vertical,
  613. physics: const BouncingScrollPhysics(),
  614. clipBehavior: Clip.none,
  615. child: Column(
  616. children: [
  617. Container(
  618. color: context.appColors.backgroundDark,
  619. padding: const EdgeInsets.only(top: 15),
  620. child: Column(
  621. children: [
  622. _buildSaleItem(context, ref, _vm, detailInfo),
  623. // _buildDeal(context, ref, _vm),
  624. _buildPackage(context, ref, _vm, detailInfo),
  625. _buildNotice(context, ref, _vm, detailInfo),
  626. // _buildInstructions(context, ref, _vm),
  627. _buildRedeemable(
  628. context, ref, _vm, detailInfo),
  629. ],
  630. )),
  631. ],
  632. ))),
  633. Container(
  634. height: 50,
  635. color: context.appColors.btnBgDefault,
  636. child: Flex(
  637. direction: Axis.horizontal,
  638. children: [
  639. Expanded(
  640. flex: 1,
  641. child: Container(
  642. color: context.appColors.btnBgDefault,
  643. height: 100,
  644. child: Row(
  645. mainAxisAlignment: MainAxisAlignment.center,
  646. crossAxisAlignment: CrossAxisAlignment.center,
  647. children: [
  648. MyTextView(
  649. S.current.redeem,
  650. fontSize: 16,
  651. textColor: Colors.white,
  652. isFontMedium: true,
  653. ),
  654. ],
  655. ),
  656. ).onTap(() {
  657. RewardsConfirmPage.startInstance(id: detailInfo?.id);
  658. }),
  659. ),
  660. ],
  661. ),
  662. )
  663. ],
  664. )),
  665. );
  666. }
  667. }