index.dart 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:vitalapp/database/entities/defines.dart';
  4. class ContractUtils {
  5. String contractStateTransition(ContractStateEnum state) {
  6. switch (state) {
  7. case ContractStateEnum.Unsigned:
  8. return "待签约";
  9. case ContractStateEnum.Cancelled:
  10. return "已解约";
  11. case ContractStateEnum.Expired:
  12. return "已过期";
  13. case ContractStateEnum.Signed:
  14. return "已签约";
  15. case ContractStateEnum.Voided:
  16. return "已作废";
  17. case ContractStateEnum.Refused:
  18. return "已拒签";
  19. default:
  20. return "";
  21. }
  22. }
  23. Color contractStateColors(ContractStateEnum state) {
  24. switch (state) {
  25. case ContractStateEnum.Unsigned:
  26. return Colors.grey;
  27. case ContractStateEnum.Cancelled:
  28. return Colors.red;
  29. case ContractStateEnum.Expired:
  30. return Colors.orange;
  31. case ContractStateEnum.Signed:
  32. return Colors.green;
  33. case ContractStateEnum.Voided:
  34. return Colors.red;
  35. case ContractStateEnum.Refused:
  36. return const Color.fromARGB(255, 4, 66, 116);
  37. default:
  38. return Colors.blue;
  39. }
  40. }
  41. String dataOfflineStatus(bool state) {
  42. if (state) {
  43. return "未上传";
  44. } else {
  45. return "已上传";
  46. }
  47. }
  48. Color dataOfflineColor(bool state) {
  49. if (state) {
  50. return Colors.red;
  51. } else {
  52. return Colors.green;
  53. }
  54. }
  55. }