GlassTextField constructor

const GlassTextField({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. String? placeholder,
  5. Widget? prefixIcon,
  6. Widget? suffixIcon,
  7. VoidCallback? onSuffixTap,
  8. String? suffixSemanticLabel,
  9. bool obscureText = false,
  10. TextInputType? keyboardType,
  11. TextInputAction? textInputAction,
  12. int maxLines = 1,
  13. int? minLines,
  14. int? maxLength,
  15. bool enabled = true,
  16. bool readOnly = false,
  17. bool autofocus = false,
  18. ValueChanged<String>? onChanged,
  19. ValueChanged<String>? onSubmitted,
  20. ValueChanged<int>? onLineCountChanged,
  21. List<TextInputFormatter>? inputFormatters,
  22. TextCapitalization textCapitalization = TextCapitalization.none,
  23. Iterable<String>? autofillHints = const <String>[],
  24. bool autocorrect = true,
  25. bool enableSuggestions = true,
  26. TextSelectionControls? selectionControls,
  27. TextStyle? textStyle,
  28. TextStyle? placeholderStyle,
  29. EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
  30. double iconSpacing = 12.0,
  31. CrossAxisAlignment iconAlignment = CrossAxisAlignment.center,
  32. double? height,
  33. double? minHeight,
  34. double? maxHeight,
  35. Widget? bottom,
  36. LiquidShape shape = const LiquidRoundedRectangle(borderRadius: 10),
  37. LiquidGlassSettings? settings,
  38. bool useOwnLayer = false,
  39. GlassQuality? quality,
  40. GlassSurfaceStyle? surfaceStyle,
  41. Color? color,
  42. GlassInteractionBehavior interactionBehavior = GlassInteractionBehavior.full,
  43. double pressScale = 1.03,
  44. Color? glowColor,
  45. double glowRadius = 1.5,
  46. TapRegionCallback? onTapOutside,
})

Creates a glass text field.

Implementation

const GlassTextField({
  super.key,
  this.controller,
  this.focusNode,
  this.placeholder,
  this.prefixIcon,
  this.suffixIcon,
  this.onSuffixTap,
  this.suffixSemanticLabel,
  this.obscureText = false,
  this.keyboardType,
  this.textInputAction,
  this.maxLines = 1,
  this.minLines,
  this.maxLength,
  this.enabled = true,
  this.readOnly = false,
  this.autofocus = false,
  this.onChanged,
  this.onSubmitted,
  this.onLineCountChanged,
  this.inputFormatters,
  this.textCapitalization = TextCapitalization.none,
  this.autofillHints = const <String>[],
  this.autocorrect = true,
  this.enableSuggestions = true,
  this.selectionControls,
  this.textStyle,
  this.placeholderStyle,
  this.padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
  this.iconSpacing = 12.0,
  this.iconAlignment = CrossAxisAlignment.center,
  this.height,
  this.minHeight,
  this.maxHeight,
  this.bottom,
  this.shape = const LiquidRoundedRectangle(borderRadius: 10),
  this.settings,
  this.useOwnLayer = false,
  this.quality,
  this.surfaceStyle,
  this.color,
  // ── iOS 26 interaction ────────────────────────────────────────────────────────────
  this.interactionBehavior = GlassInteractionBehavior.full,
  this.pressScale = 1.03,
  this.glowColor,
  this.glowRadius = 1.5,
  this.onTapOutside,
}) : assert(
        height == null || (minHeight == null && maxHeight == null),
        'height is mutually exclusive with minHeight / maxHeight. '
        'Use either height for a fixed size, or minHeight/maxHeight for '
        'a constrained range.',
      );