property_ioan_vm.dart 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import 'package:cs_resources/generated/assets.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
  4. import 'package:plugin_platform/engine/toast/toast_engine.dart';
  5. import 'package:riverpod_annotation/riverpod_annotation.dart';
  6. import 'package:shared/utils/color_utils.dart';
  7. import 'package:shared/utils/log_utils.dart';
  8. import 'package:widgets/my_text_view.dart';
  9. import '../../components/bottomDialog.dart';
  10. import './property_ioan_state.dart';
  11. part 'property_ioan_vm.g.dart';
  12. @riverpod
  13. class PropertyIoanVm extends _$PropertyIoanVm {
  14. PropertyIoanState initState() {
  15. return PropertyIoanState(
  16. lowestFloatingRate: "3.79%",
  17. lowestFixedRate: "2.48%",
  18. othersOfferingPic: "",
  19. othersOfferingInfoList: [
  20. {
  21. "floating": "3.08%",
  22. "fixed": "3.79%",
  23. },
  24. {
  25. "floating": "3.08%",
  26. "fixed": "3.79%",
  27. }
  28. ],
  29. offerTextInfoList: [
  30. {
  31. "title": "New HomeLoans",
  32. "icon": Assets.propertyNewHomeLoans,
  33. "iconWidth": 46.0,
  34. "iconHeight": 42.5
  35. },
  36. {
  37. "title": "Refinancing",
  38. "icon": Assets.propertyRefinancing,
  39. "iconWidth": 37.0,
  40. "iconHeight": 41.5
  41. },
  42. {
  43. "title": "Home EquityLoans",
  44. "icon": Assets.propertyHomeEquityLoans,
  45. "iconWidth": 41.5,
  46. "iconHeight": 42.5
  47. },
  48. {
  49. "title": "ConveyancingLawyer",
  50. "icon": Assets.propertyConveyancingLawyer,
  51. "iconWidth": 42.0,
  52. "iconHeight": 42.0
  53. },
  54. {
  55. "title": "Approval in Principle",
  56. "icon": Assets.propertyApproval,
  57. "iconWidth": 41.0,
  58. "iconHeight": 39.0
  59. },
  60. {
  61. "title": "OverseasHome Loan",
  62. "icon": Assets.propertyOverseasHomeLoan,
  63. "iconWidth": 36.0,
  64. "iconHeight": 39.0
  65. }
  66. ]
  67. );
  68. }
  69. @override
  70. PropertyIoanState build(){
  71. // 引入数据仓库
  72. // propertyIoanRepository = ref.read(propertyIoanRepositoryProvider);
  73. // 初始化状态
  74. PropertyIoanState state = initState();
  75. // 初始化列表数据
  76. return state;
  77. }
  78. requestQuoteConfirmAction(){
  79. Log.d("点击了确定");
  80. DialogEngine.dismiss(tag: "requestQuote");
  81. }
  82. requestQuoteCancelAction(){
  83. Log.d("点击了取消");
  84. }
  85. handlerRequestQuote(BuildContext context) async {
  86. Log.d("点击了请求报价");
  87. // ToastEngine.show("暂未开放");
  88. await DialogEngine.show(
  89. tag: "requestQuote",
  90. position: DialogPosition.bottom,
  91. widget: BottomDialog(
  92. confirmAction: requestQuoteConfirmAction,
  93. cancelAction: requestQuoteCancelAction,
  94. messageBuilder: (context) {
  95. return Container(
  96. padding: const EdgeInsets.only(left: 15,right: 15),
  97. child: Column(
  98. mainAxisAlignment: MainAxisAlignment.start,
  99. crossAxisAlignment: CrossAxisAlignment.start,
  100. children: [
  101. MyTextView(
  102. "Submit Request?",
  103. textColor: ColorUtils.string2Color('#000000'),
  104. textAlign: TextAlign.left,
  105. fontWeight: FontWeight.w500,
  106. fontSize: 21,
  107. // maxLines: 5,
  108. marginBottom: 20,
  109. ),
  110. MyTextView(
  111. "A mortgage specialist will be incontact to help you compare theatest housing loan rates and tosecure the best package that suitsyour need",
  112. textColor: ColorUtils.string2Color('#666666'),
  113. textAlign: TextAlign.left,
  114. // maxLines: 5,
  115. ),
  116. MyTextView(
  117. "This is a complementary servicebrought to you by YY Home",
  118. textColor: ColorUtils.string2Color('#666666'),
  119. textAlign: TextAlign.left,
  120. // maxLines: 5,
  121. marginTop: 15,
  122. ),
  123. ]
  124. )
  125. );
  126. },
  127. ),
  128. );
  129. }
  130. }