configure_input.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:fis_ui/index.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/services.dart';
  4. /// 配置项的输入框
  5. class FConfigureInput extends FStatelessWidget {
  6. /// 输入框提示
  7. final String? hintText;
  8. /// 校验
  9. final List<TextInputFormatter>? inputFormatters;
  10. /// 文本控制器
  11. final TextEditingController? textController;
  12. /// 输入框文本输入
  13. final ValueCallback? onChanged;
  14. /// 只读
  15. final bool? readOnly;
  16. /// 禁用
  17. final bool? enabled;
  18. FConfigureInput({
  19. this.hintText,
  20. this.inputFormatters,
  21. this.textController,
  22. this.onChanged,
  23. this.readOnly,
  24. this.enabled,
  25. });
  26. @override
  27. FWidget build(BuildContext context) {
  28. return FBorderInput(
  29. hintSize: 16,
  30. contentSize: 16,
  31. maxLength: 20,
  32. height: 40,
  33. hintText: hintText,
  34. inputFormatters: inputFormatters,
  35. borderColor: Color(0xffdcdfe6),
  36. onChanged: (value) => onChanged!(value),
  37. readOnly: readOnly ?? false,
  38. enabled: enabled ?? false,
  39. controller: textController,
  40. );
  41. }
  42. }