import 'package:cpt_services/components/chooseVisitTimeBottomFooter_vm.dart'; import 'package:cpt_services/components/chooseVisitTimeContent_vm.dart'; import 'package:cpt_services/components/status_card_item.dart'; import 'package:cs_resources/theme/app_colors_theme.dart'; import 'package:flutter/material.dart'; import 'package:auto_route/auto_route.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:shared/utils/log_utils.dart'; import 'package:widgets/ext/ex_widget.dart'; import 'package:widgets/my_text_view.dart'; import 'package:widgets/widget_export.dart'; import 'package:widgets/my_cart_num.dart'; class ChooseVisitTimeBottomFooter extends HookConsumerWidget { final int id; final int serviceTypeCode; const ChooseVisitTimeBottomFooter({Key? key,required this.id, required this.serviceTypeCode}) : super(key: key); @override Widget build(BuildContext context, WidgetRef ref) { final vm = ref.read(chooseVisitTimeBottomFooterVmProvider.notifier); final state = ref.watch(chooseVisitTimeBottomFooterVmProvider); final totalPrice = ref.watch(chooseVisitTimeContentVmProvider.select((state) => state.totalPrice)); useEffect((){ // 组件挂载时执行 - 执行接口请求 // Future.microtask(() => vm.initPageData()); return () { // 组件卸载时执行 }; },[]); return Container( height: 50, width: double.infinity, child: Row( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ Container( constraints: const BoxConstraints( minWidth: 122, ), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ Container( alignment: Alignment.center, padding: const EdgeInsets.only(left:5, right: 0,top:5,bottom: 5), child: Row( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ MyTextView( "\$$totalPrice", fontSize: 18, textColor: Colors.white, isFontRegular: true, maxLines:2, isTextEllipsis: true, marginLeft: 5, marginRight: 15, ), ], ), ), ], ).backgroundColor(context.appColors.textPrimary), ), Expanded( child: Container( color: context.appColors.redDefault, child: Center( child: MyTextView( 'Confirm', textColor: context.appColors.textWhite, fontSize: 17, isFontMedium: true, textAlign: TextAlign.center, ), ), ).onTap((){ vm.handlerClickVisitTimeConfirm(context, id: id , serviceTypeCode: serviceTypeCode); }), ), ], ), ); } }