property_ioan_page.dart 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. import 'package:cpt_property/components/bottomDialog.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import 'package:cs_resources/theme/app_colors_theme.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:auto_route/auto_route.dart';
  6. import 'package:hooks_riverpod/hooks_riverpod.dart';
  7. import 'package:plugin_platform/engine/toast/toast_engine.dart';
  8. import 'package:router/ext/auto_router_extensions.dart';
  9. import 'package:shared/utils/color_utils.dart';
  10. import 'package:widgets/ext/ex_widget.dart';
  11. import 'package:widgets/my_button.dart';
  12. import 'package:widgets/my_load_image.dart';
  13. import 'package:widgets/my_text_view.dart';
  14. import '../../../router/page/property_page_router.dart';
  15. import 'property_ioan_vm.dart';
  16. @RoutePage()
  17. class PropertyIoanPage extends HookConsumerWidget {
  18. const PropertyIoanPage({Key? key}) : super(key: key);
  19. //启动当前页面
  20. static void startInstance({BuildContext? context}) {
  21. if (context != null) {
  22. context.router.push(const PropertyIoanPageRoute());
  23. } else {
  24. appRouter.push(const PropertyIoanPageRoute());
  25. }
  26. }
  27. Widget _buildContentTopAdviceSection(BuildContext context,WidgetRef ref, _vm){
  28. return Column(
  29. children: [
  30. MyTextView(
  31. "YY Home",
  32. textColor: ColorUtils.string2Color('#000000'),
  33. fontSize: 27,
  34. isFontMedium: true,
  35. textAlign: TextAlign.center,
  36. ),
  37. MyTextView(
  38. "Find the best home loan for you",
  39. textColor: ColorUtils.string2Color('#000000'),
  40. fontSize: 16,
  41. isFontRegular: true,
  42. marginBottom: 14,
  43. textAlign: TextAlign.center,
  44. ),
  45. Container(
  46. width: double.infinity,
  47. height: 210,
  48. decoration: BoxDecoration(
  49. borderRadius: BorderRadius.circular(0),
  50. color: ColorUtils.string2Color('#FEFEFE'),
  51. image: const DecorationImage(
  52. image: AssetImage('packages/cs_resources/${Assets.propertyHomeLoanBg}'), // 使用包中的资源
  53. fit: BoxFit.cover,
  54. ),
  55. ),
  56. child: Column(
  57. children: [
  58. MyTextView(
  59. "YY Home exclusive rates:",
  60. textColor: ColorUtils.string2Color('#FEFEFE'),
  61. fontSize: 15,
  62. boxWidth: 237,
  63. boxHeight: 35,
  64. alignment: Alignment.center,
  65. textAlign: TextAlign.center,
  66. marginTop: 5.5,
  67. backgroundColor: ColorUtils.string2Color('#4161D0')
  68. ),
  69. Expanded(
  70. child: Row(
  71. mainAxisAlignment: MainAxisAlignment.center,
  72. children: [
  73. Container(
  74. width: 105,
  75. height: 105,
  76. padding: const EdgeInsets.all(5),
  77. color: ColorUtils.string2Color('#4161D0'),
  78. child: Column(
  79. mainAxisAlignment: MainAxisAlignment.center,
  80. crossAxisAlignment: CrossAxisAlignment.center,
  81. children: [
  82. MyTextView(
  83. _vm.state.lowestFloatingRate,
  84. textColor: ColorUtils.string2Color('#FEFEFE'),
  85. fontSize: 30,
  86. ),
  87. MyTextView(
  88. "Lowest Floating Rate",
  89. textColor: ColorUtils.string2Color('#FEFEFE'),
  90. fontSize: 14,
  91. textAlign: TextAlign.center,
  92. ),
  93. ]
  94. )
  95. ),
  96. Container(
  97. width: 105,
  98. height: 105,
  99. padding: const EdgeInsets.all(5),
  100. color: ColorUtils.string2Color('#4161D0'),
  101. margin: const EdgeInsets.only(left: 18),
  102. child: Column(
  103. mainAxisAlignment: MainAxisAlignment.center,
  104. crossAxisAlignment: CrossAxisAlignment.center,
  105. children: [
  106. MyTextView(
  107. _vm.state.lowestFixedRate,
  108. textColor: ColorUtils.string2Color('#FEFEFE'),
  109. fontSize: 30,
  110. ),
  111. MyTextView(
  112. "Lowest Floating Rate",
  113. textColor: ColorUtils.string2Color('#FEFEFE'),
  114. fontSize: 14,
  115. textAlign: TextAlign.center,
  116. ),
  117. ]
  118. )
  119. ),
  120. ],
  121. ),
  122. ),
  123. ],
  124. ),
  125. ),
  126. MyTextView(
  127. "Check out what others are offering:",
  128. textColor: ColorUtils.string2Color('#FEFEFE'),
  129. fontSize: 15,
  130. boxWidth: double.infinity,
  131. boxHeight: 40.5,
  132. alignment: Alignment.center,
  133. textAlign: TextAlign.center,
  134. backgroundColor: ColorUtils.string2Color('#4161D0'),
  135. ),
  136. const SizedBox(height: 20),
  137. Row(
  138. mainAxisAlignment: MainAxisAlignment.start,
  139. children: [
  140. MyLoadImage(
  141. Assets.propertyAdvicePic,
  142. width: 132,
  143. // height: 122.5,
  144. ),
  145. Expanded(
  146. child: Container(
  147. // color: Colors.red,
  148. padding: const EdgeInsets.only(left: 50,right: 20),
  149. child: Column(
  150. // mainAxisAlignment: MainAxisAlignment.end,
  151. crossAxisAlignment: CrossAxisAlignment.start,
  152. children: [
  153. Row(
  154. mainAxisAlignment: MainAxisAlignment.center,
  155. children: [
  156. MyTextView(
  157. "Floating",
  158. textColor: ColorUtils.string2Color('#000000'),
  159. fontSize: 14,
  160. textAlign: TextAlign.center,
  161. ),
  162. MyTextView(
  163. "Fixed",
  164. textColor: ColorUtils.string2Color('#000000'),
  165. fontSize: 14,
  166. textAlign: TextAlign.center,
  167. marginLeft: 50.5,
  168. ),
  169. ],
  170. ),
  171. // const SizedBox(height: 10),
  172. Expanded(child: Column(
  173. mainAxisAlignment: MainAxisAlignment.center,
  174. children: [
  175. Row(
  176. mainAxisAlignment: MainAxisAlignment.center,
  177. children: [
  178. MyTextView(
  179. "3.08%",
  180. textColor: ColorUtils.string2Color('#000000'),
  181. fontSize: 16,
  182. textAlign: TextAlign.center,
  183. isFontMedium: true,
  184. marginLeft: 15,
  185. ),
  186. MyTextView(
  187. "2.50%",
  188. textColor: ColorUtils.string2Color('#000000'),
  189. fontSize: 16,
  190. textAlign: TextAlign.center,
  191. isFontMedium: true,
  192. marginLeft: 50.5,
  193. ),
  194. ],
  195. ),
  196. Row(
  197. mainAxisAlignment: MainAxisAlignment.center,
  198. children: [
  199. MyTextView(
  200. "3.08%",
  201. textColor: ColorUtils.string2Color('#000000'),
  202. fontSize: 16,
  203. textAlign: TextAlign.center,
  204. isFontMedium: true,
  205. marginLeft: 15,
  206. ),
  207. MyTextView(
  208. "2.50%",
  209. textColor: ColorUtils.string2Color('#000000'),
  210. fontSize: 16,
  211. textAlign: TextAlign.center,
  212. isFontMedium: true,
  213. marginLeft: 50.5,
  214. ),
  215. ],
  216. ).marginOnly(top: 15),
  217. Row(
  218. mainAxisAlignment: MainAxisAlignment.center,
  219. children: [
  220. MyTextView(
  221. "3.08%",
  222. textColor: ColorUtils.string2Color('#000000'),
  223. fontSize: 16,
  224. textAlign: TextAlign.center,
  225. isFontMedium: true,
  226. marginLeft: 15,
  227. ),
  228. MyTextView(
  229. "2.50%",
  230. textColor: ColorUtils.string2Color('#000000'),
  231. fontSize: 16,
  232. textAlign: TextAlign.center,
  233. isFontMedium: true,
  234. marginLeft: 47.5,
  235. ),
  236. ],
  237. ).marginOnly(top: 15),
  238. ],
  239. ))
  240. ],
  241. ),
  242. ),
  243. ),
  244. ],
  245. ).constrained(height: 160),
  246. ],
  247. );
  248. }
  249. Widget _buildContentMiddleTextSection(BuildContext context,WidgetRef ref, _vm) {
  250. return Column(
  251. children: [
  252. MyTextView(
  253. "The right advice to help you choose the best package in the market!",
  254. textColor: ColorUtils.string2Color('#000000'),
  255. fontSize: 18,
  256. isFontMedium: true,
  257. marginTop: 20,
  258. marginBottom: 20,
  259. textAlign: TextAlign.center,
  260. ),
  261. MyTextView(
  262. "-No Hidden Fees, We Are Out ToHelp You!-Interest Savings With Lowest RatesGuarantee-One-Stop Access to All The BanksPackages",
  263. textColor: ColorUtils.string2Color('#000000'),
  264. fontSize: 15,
  265. textAlign: TextAlign.center,
  266. marginBottom: 20,
  267. ),
  268. ],
  269. );
  270. }
  271. Widget _buildContentOfferSection(BuildContext context,WidgetRef ref, _vm) {
  272. final offerTextInfoList = _vm.state.offerTextInfoList.map((value) => value).toList();
  273. return Container(
  274. width: double.infinity,
  275. child: Column(
  276. children: [
  277. MyTextView(
  278. "What do we offer?",
  279. textColor: ColorUtils.string2Color('#000000'),
  280. fontSize: 18,
  281. isFontMedium: true,
  282. marginTop: 16.5,
  283. marginBottom: 16.5,
  284. ),
  285. Wrap(
  286. children: List.generate(offerTextInfoList.length, (index){
  287. return Container(
  288. width: MediaQuery.of(context).size.width / 2 - 100,
  289. margin: const EdgeInsets.only(right: 15,bottom: 15),
  290. padding: const EdgeInsets.only(left: 15,right: 15,top:15,bottom:15,),
  291. // decoration: BoxDecoration(
  292. // borderRadius: BorderRadius.circular(10),
  293. // color: ColorUtils.string2Color('#F5F5F5'),
  294. // ),
  295. child: Column(
  296. children: [
  297. MyLoadImage(
  298. offerTextInfoList[index]["icon"],
  299. width: offerTextInfoList[index]["iconWidth"],
  300. height: offerTextInfoList[index]["iconHeight"],
  301. ),
  302. const SizedBox(height: 13,),
  303. MyTextView(
  304. offerTextInfoList[index]["title"],
  305. fontSize: 15,
  306. textColor: ColorUtils.string2Color('#000000'),
  307. textAlign: TextAlign.center,
  308. ),
  309. ]
  310. ),
  311. );
  312. }),
  313. ),
  314. ]
  315. ),
  316. );
  317. }
  318. Widget _buildContentBottomPartnersSection(BuildContext context,WidgetRef ref, _vm) {
  319. return Column(
  320. mainAxisAlignment: MainAxisAlignment.center,
  321. crossAxisAlignment: CrossAxisAlignment.center,
  322. children: [
  323. MyTextView(
  324. "Our Partners",
  325. textColor: ColorUtils.string2Color('#000000'),
  326. fontSize: 18,
  327. isFontMedium: true,
  328. marginBottom: 16.5,
  329. ),
  330. MyLoadImage(Assets.propertyOurPartners,),
  331. ],
  332. );
  333. }
  334. Widget _buildCotentBox(BuildContext context,WidgetRef ref, _vm) {
  335. return Column(
  336. children: [
  337. _buildContentTopAdviceSection(context, ref, _vm),
  338. const SizedBox(height: 15,),
  339. _buildContentMiddleTextSection(context, ref, _vm),
  340. const SizedBox(height: 15,),
  341. _buildContentOfferSection(context, ref, _vm),
  342. const SizedBox(height: 15,),
  343. _buildContentBottomPartnersSection(context, ref, _vm),
  344. ],
  345. );
  346. }
  347. @override
  348. Widget build(BuildContext context, WidgetRef ref) {
  349. final _vm = ref.read(propertyIoanVmProvider.notifier);
  350. return Scaffold(
  351. backgroundColor: ColorUtils.string2Color("#F2F3F6"),
  352. // appBar: AppBar(title: Text("资产")),
  353. body: Column(
  354. children: [
  355. Expanded(
  356. child: SingleChildScrollView(
  357. scrollDirection: Axis.vertical,
  358. physics: const BouncingScrollPhysics(),
  359. clipBehavior: Clip.none,
  360. child: Padding(
  361. padding: const EdgeInsets.only(left: 15,right: 15,top: 15),
  362. child: _buildCotentBox(context, ref, _vm),
  363. )
  364. )
  365. ),
  366. Container(
  367. height: 50,
  368. color: ColorUtils.string2Color('#4161D0'),
  369. child: Row(
  370. mainAxisAlignment: MainAxisAlignment.center,
  371. children: [
  372. // MyLoadImage(Assets.propertyIoanItemBg,width: 60,height: 50,),
  373. const SizedBox(width: 10,),
  374. MyTextView(
  375. "Request a Quote",
  376. fontSize: 16,
  377. textColor: Colors.white,
  378. isFontMedium: true,
  379. ),
  380. ],
  381. ),
  382. ).onTap((){
  383. _vm.handlerRequestQuote(context);
  384. })
  385. ],
  386. ),
  387. );
  388. }
  389. }