add_card_state.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:cs_resources/generated/l10n.dart';
  2. import 'package:flutter/material.dart';
  3. class AddCardState {
  4. //表单的校验与数据
  5. final Map<String, Map<String, dynamic>> formData;
  6. AddCardState({
  7. Map<String, Map<String, dynamic>>? formData,
  8. }) : formData = formData ??
  9. {
  10. 'card_name': {
  11. 'value': '',
  12. 'controller': TextEditingController(),
  13. 'hintText': S.current.name_on_card,
  14. 'focusNode': FocusNode(),
  15. 'obsecure': false,
  16. },
  17. 'card_number': {
  18. 'value': '',
  19. 'controller': TextEditingController(),
  20. 'hintText': S.current.card_number,
  21. 'focusNode': FocusNode(),
  22. 'obsecure': false,
  23. },
  24. 'month': {
  25. 'value': '',
  26. 'controller': TextEditingController(),
  27. 'hintText': 'MM',
  28. 'focusNode': FocusNode(),
  29. 'obsecure': false,
  30. },
  31. 'year': {
  32. 'value': '',
  33. 'controller': TextEditingController(),
  34. 'hintText': 'YY',
  35. 'focusNode': FocusNode(),
  36. 'obsecure': false,
  37. },
  38. 'cyc': {
  39. 'value': '',
  40. 'controller': TextEditingController(),
  41. 'hintText': 'CYC',
  42. 'focusNode': FocusNode(),
  43. 'obsecure': false,
  44. },
  45. };
  46. }