Obx class

The simplest reactive widget in GetX.

Just pass your Rx variable in the root scope of the callback to have it automatically registered for changes.

final _name = "GetX".obs; Obx(() => Text( _name.value )),... ;

Inheritance
Available extensions

Constructors

Obx(WidgetCallback builder, {Key? key})
const

Properties

builder → WidgetCallback
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
marginZero → Widget

Available on Widget, provided by the WidgetExtensions extension

Zero margin
no setter
paddingZero → Widget

Available on Widget, provided by the WidgetExtensions extension

Zero padding
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sliverBox → Widget

Available on Widget, provided by the WidgetSliverBoxX extension

no setter

Methods

backgroundColor(Color color, {double opacity = 1.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Background color with optional opacity
blur({double begin = 0, double end = 15, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a blur animation to the widget.
bounce({required double begin, required double end, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a bounce animation to the widget.
build() → Widget
override
centered({bool horizontal = true, bool vertical = true}) → Widget

Available on Widget, provided by the WidgetResponsiveX extension

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → ObxState
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
expand({int flex = 1}) → Widget

Available on Widget, provided by the WidgetResponsiveX extension

fadeIn({Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a fade-in animation to the widget.
fadeOut({Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a fade-out animation to the widget.
flip({double begin = 0, double end = 1, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a flip animation to the widget.
intlToNumberFormat(int number) → String

Available on Widget, provided by the WidgetExtensions extension

Formats an integer with comma-separated thousands using intl NumberFormat
marginAll(double margin) → Widget

Available on Widget, provided by the WidgetExtensions extension

Margin with validation and flexible options
marginOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Margin only on specified sides with validation
marginSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Symmetric margin with validation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paddingAll(double padding) → Widget

Available on Widget, provided by the WidgetExtensions extension

Padding with validation and flexible options
paddingOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Padding only on specified sides with validation
paddingSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Symmetric padding with validation
responsive({double? width, double? height, EdgeInsets? padding}) → Widget

Available on Widget, provided by the ResponsiveWidgetExtension extension

Wraps the widget in a SizedBox and Padding with responsive width, height, and padding.
responsiveBuilder({ResponsiveMode mode = ResponsiveMode.layoutBuilder, Widget builder(BuildContext context, ResponsiveData data, Widget child)?}) → Widget

Available on Widget, provided by the GetResponsiveBuilderExtension extension

Wrap widget with GetResponsiveBuilder
responsivePadding({EdgeInsetsGeometry? phone, EdgeInsetsGeometry? tablet, EdgeInsetsGeometry? laptop, EdgeInsetsGeometry? desktop, EdgeInsetsGeometry? all}) → Widget

Available on Widget, provided by the ResponsiveVisibilityExtension extension

Apply different padding based on device type
responsiveVisibility({bool phone = true, bool tablet = true, bool laptop = true, bool desktop = true, bool tv = true, Widget replacement = const SizedBox.shrink()}) → Widget

Available on Widget, provided by the ResponsiveVisibilityExtension extension

Show widget only on specific device types
rotate(double degrees) → Widget

Available on Widget, provided by the WidgetExtensions extension

Rotates the widget by a specified number of degrees
rotate({required double begin, required double end, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a rotation animation to the widget.
scale({required double begin, required double end, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a scale animation to the widget.
scale(double scaleFactor) → Widget

Available on Widget, provided by the WidgetExtensions extension

Scales the widget by a specified factor
size({required double begin, required double end, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a size animation to the widget.
slide({required OffsetBuilder offset, double begin = 0, double end = 1, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a slide animation to the widget (legacy method for backward compatibility).
slideIn({SlideType type = SlideType.left, double distance = 1.0, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a slide animation to the widget with predefined slide types.
slideOut({SlideType type = SlideType.left, double distance = 1.0, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a slide-out animation to the widget.
sliverBoxWithKey(Key key) → Widget

Available on Widget, provided by the WidgetSliverBoxX extension

spin({Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a spin animation to the widget.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited
visible(bool isVisible) → Widget

Available on Widget, provided by the WidgetExtensions extension

Conditionally display the widget based on the isVisible flag
wave({double begin = 0, double end = 1, Duration duration = _defaultDuration, Duration delay = _defaultDelay, ValueSetter<AnimationController>? onComplete, bool isSequential = false}) → GetAnimatedBuilder

Available on Widget, provided by the AnimationExtension extension

Adds a wave animation to the widget.
withBorder({Color color = Colors.black, double width = 1.0}) → Widget

Available on Widget, provided by the WidgetExtensions extension

Adds a border to the widget with customizable color and width

Operators

operator ==(Object other) → bool
The equality operator.
inherited