chooseAirConditionTitle.dart 2.3 KB

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