id_card.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'dart:ui';
  2. class IDCardRecognition {
  3. Future<bool> initiate(ModelDataInformation modelDataInfo) async {
  4. return true;
  5. }
  6. Future<IDCardRecogResultInfo?> evaluateOneImage(Image image) async {
  7. try {
  8. return null;
  9. } catch (e) {
  10. return null;
  11. }
  12. }
  13. void writeDatatoFile() {}
  14. String _addLeadingZero(int value) {
  15. return value.toString().padLeft(2, '0');
  16. }
  17. void release() {}
  18. }
  19. class ModelDataInformation {
  20. final String ocrv4DetInfer;
  21. final String ocrv4RecInfer;
  22. final String ppocrKeysV1;
  23. final String ppocrMobileClsTrain;
  24. ModelDataInformation({
  25. required this.ocrv4DetInfer,
  26. required this.ocrv4RecInfer,
  27. required this.ppocrKeysV1,
  28. required this.ppocrMobileClsTrain,
  29. });
  30. }
  31. // 定义 IDCardRecogResult 结构体
  32. class IDCardRecogResultInfo {
  33. int numerStatus;
  34. String? name;
  35. String? idNumber;
  36. String? gender;
  37. String? nation;
  38. String? birthdate;
  39. String? address;
  40. IDCardRecogResultInfo({
  41. this.numerStatus = 0,
  42. this.name,
  43. this.idNumber,
  44. this.gender,
  45. this.nation,
  46. this.birthdate,
  47. this.address,
  48. });
  49. }