GlassFocusRegion.observe constructor
GlassFocusRegion.observe({
- required Widget child,
- required FocusNode focusNode,
- required ShapeBorder shape,
- Key? key,
Observe mode: paints the focus ring by listening to an external FocusNode without creating a FocusableActionDetector.
Use this for GlassTextField, GlassSearchBar, or any widget where CupertinoTextField already manages the focus lifecycle. The wrapped widget retains full control of its FocusNode and keyboard handling.
Implementation
// ignore: prefer_const_constructors_in_immutables
GlassFocusRegion.observe({
required this.child,
required FocusNode focusNode,
required ShapeBorder
shape, // non-nullable; field is ShapeBorder? so this.shape would widen the type
super.key,
}) : observedFocusNode = focusNode,
enabled = true,
shape = shape, // ignore: prefer_initializing_formals
isFocusedNotifier = null,
isHoveredNotifier = null,
focusNode = null,
canRequestFocus = false,
autofocus = false,
semanticLabel = null,
isButton = false,
isSlider = false,
tracksSelection = false,
isSelected = false,
toggled = null,
onKeyboardActivate = null,
semanticOnTap = null,
semanticOnLongPress = null,
semanticValue = null,
semanticIncreasedValue = null,
semanticDecreasedValue = null,
semanticOnIncrease = null,
semanticOnDecrease = null;