import 'package:fis_jsonrpc/rpc.dart';
import 'package:flutter/material.dart';

class ContractUtils {
  String contractStateTransition(ContractStateEnum state) {
    switch (state) {
      case ContractStateEnum.Unsigned:
        return "待签约";
      case ContractStateEnum.Cancelled:
        return "已解约";
      case ContractStateEnum.Expired:
        return "已过期";
      case ContractStateEnum.Signed:
        return "已签约";
      default:
        return "";
    }
  }

  MaterialColor contractStateColors(ContractStateEnum state) {
    switch (state) {
      case ContractStateEnum.Unsigned:
        return Colors.grey;
      case ContractStateEnum.Cancelled:
        return Colors.red;
      case ContractStateEnum.Expired:
        return Colors.orange;
      case ContractStateEnum.Signed:
        return Colors.green;
      default:
        return Colors.blue;
    }
  }
}
