chooseHouseCleanTitle.dart 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import 'package:cpt_services/components/chooseHouseCleanContent_vm.dart';
  2. import 'package:cpt_services/components/chooseVisitTimeContent_vm.dart';
  3. import 'package:cpt_services/components/chooseVisitTimeTitle_vm.dart';
  4. import 'package:cpt_services/modules/services/service_clean_detail/service_clean_detail_vm.dart';
  5. import 'package:cpt_services/modules/services/service_order_confirm/service_order_confirm_vm.dart';
  6. import 'package:cs_resources/theme/app_colors_theme.dart';
  7. import 'package:flutter/material.dart';
  8. import 'package:auto_route/auto_route.dart';
  9. import 'package:flutter_hooks/flutter_hooks.dart';
  10. import 'package:hooks_riverpod/hooks_riverpod.dart';
  11. import 'package:shared/utils/log_utils.dart';
  12. import 'package:widgets/my_text_view.dart';
  13. import 'package:widgets/widget_export.dart';
  14. // import 'chooseHouseCleanTitle_vm.dart';
  15. class ChooseHouseCleanTitle extends HookConsumerWidget {
  16. final int id;
  17. final String cleanServiceType;
  18. const ChooseHouseCleanTitle(
  19. {Key? key,required this.id, required this.cleanServiceType,}) : super(key: key);
  20. @override
  21. Widget build(BuildContext context, WidgetRef ref) {
  22. final totalPrice = ref.watch(serviceOrderConfirmVmProvider.select((state)=>state.totalPrice));
  23. final vm = ref.read(chooseVisitTimeContentVmProvider.notifier);
  24. useEffect((){
  25. // 组件挂载时执行 - 执行接口请求
  26. Future.microtask(() => vm.initPageData(context));
  27. return () {
  28. // 组件卸载时执行
  29. };
  30. },[]);
  31. return Container(
  32. child: Column(
  33. mainAxisAlignment: MainAxisAlignment.start,
  34. children: [
  35. Padding(
  36. padding: const EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
  37. child: Column(
  38. children: [
  39. MyTextView(
  40. "Select House Clean",
  41. textColor: context.appColors.textBlack,
  42. textAlign: TextAlign.left,
  43. isFontBold: true,
  44. fontSize: 17,
  45. boxWidth: double.infinity,
  46. // maxLines: 5,
  47. ),
  48. MyTextView(
  49. "\$$totalPrice",
  50. textColor: context.appColors.textPrimary,
  51. textAlign: TextAlign.left,
  52. isFontMedium: true,
  53. fontSize: 17,
  54. // maxLines: 5,
  55. boxWidth: double.infinity,
  56. ),
  57. ],
  58. ),
  59. ),
  60. // 分割线
  61. Divider(
  62. color: context.appColors.grayBgE9,
  63. height: 1,
  64. ),
  65. ],
  66. ),
  67. );
  68. }
  69. }