123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:riverpod_annotation/riverpod_annotation.dart';
- import 'package:router/ext/auto_router_extensions.dart';
- import 'package:shared/utils/log_utils.dart';
- import '../../../respository/services_respository.dart';
- import '../constants_services.dart';
- import '../modules/services/service_evaluate_create/service_evaluate_create_page.dart';
- part 'status_card_item_vm.g.dart';
- @riverpod
- class StatusCardItemVm extends _$StatusCardItemVm {
- late ServicesRespository serviceRespositoryInstance;
- late int _serviceId;
- late String _cleanServiceType;
- late int _serviceStatusCode;
- initState(){
- Log.d("--------------------------initState---------------------");
- return null;
- }
- @override
- build(){
- // 引入数据仓库
- // serviceRespositoryInstance = ref.read(servicesRespositoryProvider);
- final state = initState();
- Log.d("--------------------------build---------------------");
- return state;
- }
- // void changeLoadingState(LoadState loadState, String? errorMsg) {
- // state = state.copyWith(
- // loadingState: loadState,
- // errorMessage: errorMsg
- // );
- // }
- setInitData(BuildContext context,int serviceId, String cleanServiceType, int serviceStatusCode){
- _serviceId = serviceId;
- _cleanServiceType = cleanServiceType;
- _serviceStatusCode = serviceStatusCode;
- }
- handlerClickActionBtn(BuildContext context, Map<String, dynamic> actionBtn){
- final actionBtnCode = actionBtn['code']!.toString();
- switch (actionBtnCode) {
- case '0':
- // context.router.pushNamed('/detail');
- break;
- case '1':
- // context.router.pushNamed('/detail');
- break;
- case '2':
- // context.router.pushNamed('/detail');
- break;
- case '3':
- // context.router.pushNamed('/detail');
- break;
- case '4':
- // 去评价
- // context.router.pushNamed('/detail');
- ServiceEvaluateCreatePage.startInstance(id: _serviceId, cleanServiceType: _cleanServiceType,);
- break;
- default:
- break;
- }
- }
- }
|