123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- import 'package:cpt_property/components/bottomDialog.dart';
- import 'package:cs_resources/generated/assets.dart';
- import 'package:flutter/material.dart';
- import 'package:auto_route/auto_route.dart';
- import 'package:hooks_riverpod/hooks_riverpod.dart';
- import 'package:plugin_platform/engine/toast/toast_engine.dart';
- import 'package:router/ext/auto_router_extensions.dart';
- import 'package:shared/utils/color_utils.dart';
- import 'package:widgets/ext/ex_widget.dart';
- import 'package:widgets/my_load_image.dart';
- import 'package:widgets/my_text_view.dart';
- import '../../../router/page/property_page_router.dart';
- import 'property_ioan_vm.dart';
- @RoutePage()
- class PropertyIoanPage extends HookConsumerWidget {
- const PropertyIoanPage({Key? key}) : super(key: key);
- //启动当前页面
- static void startInstance({BuildContext? context}) {
- if (context != null) {
- context.router.push(const PropertyIoanPageRoute());
- } else {
- appRouter.push(const PropertyIoanPageRoute());
- }
- }
- Widget _buildContentTopAdviceSection(BuildContext context,WidgetRef ref, _vm){
- return Column(
- children: [
- MyTextView(
- "YY Home",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 27,
- fontWeight: FontWeight.w500,
- textAlign: TextAlign.center,
- ),
- MyTextView(
- "Find the best home loan for you",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- fontWeight: FontWeight.w400,
- marginBottom: 14,
- textAlign: TextAlign.center,
- ),
- Container(
- width: double.infinity,
- height: 210,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(0),
- color: ColorUtils.string2Color('#FEFEFE'),
- image: const DecorationImage(
- image: AssetImage('packages/cs_resources/${Assets.propertyHomeLoanBg}'), // 使用包中的资源
- fit: BoxFit.cover,
- ),
- ),
- child: Column(
- children: [
- MyTextView(
- "YY Home exclusive rates:",
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 15,
- boxWidth: 237,
- boxHeight: 35,
- alignment: Alignment.center,
- textAlign: TextAlign.center,
- marginTop: 5.5,
- backgroundColor: ColorUtils.string2Color('#4161D0')
- ),
- Expanded(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- width: 105,
- height: 105,
- padding: const EdgeInsets.all(5),
- color: ColorUtils.string2Color('#4161D0'),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- MyTextView(
- _vm.state.lowestFloatingRate,
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 30,
- ),
- MyTextView(
- "Lowest Floating Rate",
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 14,
- textAlign: TextAlign.center,
- ),
- ]
- )
- ),
- Container(
- width: 105,
- height: 105,
- padding: const EdgeInsets.all(5),
- color: ColorUtils.string2Color('#4161D0'),
- margin: const EdgeInsets.only(left: 18),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- MyTextView(
- _vm.state.lowestFixedRate,
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 30,
- ),
- MyTextView(
- "Lowest Floating Rate",
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 14,
- textAlign: TextAlign.center,
- ),
- ]
- )
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- MyTextView(
- "Check out what others are offering:",
- textColor: ColorUtils.string2Color('#FEFEFE'),
- fontSize: 15,
- boxWidth: double.infinity,
- boxHeight: 40.5,
- alignment: Alignment.center,
- textAlign: TextAlign.center,
- backgroundColor: ColorUtils.string2Color('#4161D0'),
- ),
- const SizedBox(height: 20),
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- MyLoadImage(
- Assets.propertyAdvicePic,
- width: 132,
- // height: 122.5,
- ),
- Expanded(
- child: Container(
- // color: Colors.red,
- padding: const EdgeInsets.only(left: 50,right: 20),
- child: Column(
- // mainAxisAlignment: MainAxisAlignment.end,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- MyTextView(
- "Floating",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 14,
- textAlign: TextAlign.center,
- ),
- MyTextView(
- "Fixed",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 14,
- textAlign: TextAlign.center,
- marginLeft: 47.5,
- ),
- ],
- ),
- // const SizedBox(height: 10),
- Expanded(child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- MyTextView(
- "3.08%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 20,
- ),
- MyTextView(
- "2.50%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 47.5,
- ),
- ],
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- MyTextView(
- "3.08%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 20,
- ),
- MyTextView(
- "2.50%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 47.5,
- ),
- ],
- ).marginOnly(top: 15),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- MyTextView(
- "3.08%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 20,
- ),
- MyTextView(
- "2.50%",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 16,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- marginLeft: 47.5,
- ),
- ],
- ).marginOnly(top: 15),
- ],
- ))
- ],
- ),
- ),
- ),
- ],
- ).constrained(height: 160),
- ],
- );
- }
- Widget _buildContentMiddleTextSection(BuildContext context,WidgetRef ref, _vm) {
- return Column(
- children: [
- MyTextView(
- "The right advice to help you choose the best package in the market!",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 18,
- fontWeight: FontWeight.w500,
- marginTop: 20,
- marginBottom: 20,
- textAlign: TextAlign.center,
- ),
- MyTextView(
- "-No Hidden Fees, We Are Out ToHelp You!-Interest Savings With Lowest RatesGuarantee-One-Stop Access to All The BanksPackages",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 15,
- textAlign: TextAlign.center,
- marginBottom: 20,
- ),
- ],
- );
- }
- Widget _buildContentOfferSection(BuildContext context,WidgetRef ref, _vm) {
- final offerTextInfoList = _vm.state.offerTextInfoList.map((value) => value).toList();
- return Container(
- width: double.infinity,
- child: Column(
- children: [
- MyTextView(
- "What do we offer?",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 18,
- fontWeight: FontWeight.w500,
- marginTop: 16.5,
- marginBottom: 16.5,
- ),
- Wrap(
- children: List.generate(offerTextInfoList.length, (index){
- return Container(
- width: MediaQuery.of(context).size.width / 2 - 100,
- margin: const EdgeInsets.only(right: 15,bottom: 15),
- padding: const EdgeInsets.only(left: 15,right: 15,top:15,bottom:15,),
- // decoration: BoxDecoration(
- // borderRadius: BorderRadius.circular(10),
- // color: ColorUtils.string2Color('#F5F5F5'),
- // ),
- child: Column(
- children: [
- MyLoadImage(
- offerTextInfoList[index]["icon"],
- width: offerTextInfoList[index]["iconWidth"],
- height: offerTextInfoList[index]["iconHeight"],
- ),
- const SizedBox(height: 13,),
- MyTextView(
- offerTextInfoList[index]["title"],
- fontSize: 15,
- textColor: ColorUtils.string2Color('#000000'),
- textAlign: TextAlign.center,
- ),
- ]
- ),
- );
- }),
- ),
- ]
- ),
- );
- }
- Widget _buildContentBottomPartnersSection(BuildContext context,WidgetRef ref, _vm) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- MyTextView(
- "Our Partners",
- textColor: ColorUtils.string2Color('#000000'),
- fontSize: 18,
- fontWeight: FontWeight.w500,
- marginBottom: 16.5,
- ),
- MyLoadImage(Assets.propertyOurPartners,),
- ],
- );
- }
- Widget _buildCotentBox(BuildContext context,WidgetRef ref, _vm) {
- return Column(
- children: [
- _buildContentTopAdviceSection(context, ref, _vm),
- const SizedBox(height: 15,),
- _buildContentMiddleTextSection(context, ref, _vm),
- const SizedBox(height: 15,),
- _buildContentOfferSection(context, ref, _vm),
- const SizedBox(height: 15,),
- _buildContentBottomPartnersSection(context, ref, _vm),
- ],
- );
- }
- @override
- Widget build(BuildContext context, WidgetRef ref) {
- final _vm = ref.read(propertyIoanVmProvider.notifier);
- return Scaffold(
- backgroundColor: ColorUtils.string2Color("#F2F3F6"),
- // appBar: AppBar(title: Text("资产")),
- body: Column(
- children: [
- Expanded(
- child: SingleChildScrollView(
- child: Padding(
- padding: const EdgeInsets.only(left: 15,right: 15,top: 15),
- child: _buildCotentBox(context, ref, _vm),
- )
- )
- ),
- Container(
- height: 50,
- color: ColorUtils.string2Color('#4161D0'),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- // MyLoadImage(Assets.propertyIoanItemBg,width: 60,height: 50,),
- const SizedBox(width: 10,),
- MyTextView(
- "Request a Quote",
- fontSize: 16,
- textColor: Colors.white,
- ),
- ],
- ),
- ).onTap((){
- _vm.handlerRequestQuote(context);
- })
- ],
- ),
- );
- }
- }
|