rxget library
A high performance state management, intelligent dependency injection in a quick and practical way.
Classes
-
Bind<
T> - An abstract widget that provides scoped dependency injection and lifecycle management.
-
BindElement<
T> - The BindElement is responsible for injecting dependencies into the widget tree so that they can be observed
-
Binder<
T> - Binds
- A convenience widget that applies multiple Bind widgets in order.
-
CustomStatus<
T> - DeepCollectionEquality
-
DefaultEquality<
E> -
EmptyStatus<
T> - Engine
-
ErrorStatus<
T, S> -
FastList<
T> - A fast doubly-linked list implementation for managing MiniSubscription listeners.
- FullLifeCycleController
- A controller that can observe the full app lifecycle.
-
GetBuilder<
T extends GetxController< GetxState> > - A widget that rebuilds when its associated GetxController updates.
-
GetIn<
T> - A configuration class for defining and managing a single dependency injection.
- GetInBase
- A class to define a dependency injection configuration.
- GetInterface
- GetInterface allows any auxiliary package to be merged into the "Get" class through extensions
- GetInWidget
- A widget that provides scoped dependency injection with automatic disposal.
-
GetListenable<
T> -
GetNotifier<
T> - GetNotifier has a native status and state implementation, with the Get Lifecycle
-
GetStatus<
T> -
GetView<
T> -
GetView is a great way of quickly access your Controller
without having to call
Get.find<AwesomeController>()yourself. -
GetWidget<
S extends GetLifeCycleMixin> -
GetWidget is a great way of quickly access your individual Controller
without having to call
Get.find<AwesomeController>()yourself. Get save you controller on cache, so, you can to use Get.create() safely GetWidget is perfect to multiples instance of a same controller. Each GetWidget will have your own controller, and will be call events asonInitandonClosewhen the controller get in/get out on memory. -
GetX<
T extends GetLifeCycleMixin> -
GetxController<
T extends GetxState> - A base controller class that provides state management functionality.
-
GetXState<
T extends GetLifeCycleMixin> - GetxState
- Abstract base class for state objects used with GetxController.
-
IdentityEquality<
E> - Equality of objects that compares only the identity of the objects.
-
IEquality<
E> - A generic equality relation on objects.
- InstanceInfo
- Holds metadata about a registered dependency instance.
-
IterableEquality<
E> - Equality on iterables.
-
ListEquality<
E> - Equality on lists.
-
LoadingStatus<
T> -
MapEquality<
K, V> - Equality on maps.
-
MiniStream<
T> - A lightweight stream implementation used internally by GetX's reactive system.
-
MiniSubscription<
T> - A lightweight subscription returned when listening to a MiniStream.
-
Node<
T> - A doubly-linked list node used internally by FastList.
- Obl
- A Stateless widget that registers reactive reads and runs effect on build and whenever those reads change. Does NOT rebuild the UI.
- OblElement
- Element that tracks reactive disposers
- OblStatelessWidget
- Keep the same base class you provided for compatibility
- Observer
- Obx
- The simplest reactive widget in GetX.
- ObxElement
- Element that tracks reactive disposers
- ObxError
- An error message class shown when Obx or GetX widgets are used improperly.
- ObxStatelessWidget
- A StatelessWidget than can listen reactive changes.
-
ObxValue<
T extends RxInterface> - Similar to Obx, but manages a local state. Pass the initial data in constructor. Useful for simple local states, like toggles, visibility, themes, button states, etc. Sample: ObxValue((data) => Switch( value: data.value, onChanged: (flag) => data.value = flag, ), false.obs, ),
- ObxWidget
- The ObxWidget is the base for all GetX reactive widgets
-
Rx<
T> -
Foundation class used for custom
Typesoutside the common native Dart types. For example, any custom "Model" class, like User().obs will useRxas wrapper. - RxBool
- A reactive wrapper for bool values.
- RxController
- A base controller class for reactive state management using Rx variables.
- RxDouble
- RxInt
-
RxInterface<
T> -
This class is the foundation for all reactive (Rx) classes that makes Get
so powerful.
This interface is the contract that
_RxImpl<T>uses in all it's subclass. -
RxList<
E> -
Create a list similar to
List<T> -
RxMap<
K, V> -
Rxn<
T> - A reactive wrapper for nullable types.
- RxnBool
- A reactive wrapper for nullable bool values.
- RxnDouble
- RxnInt
- RxnNum
- A reactive wrapper for nullable num values with arithmetic operators.
- RxnString
-
Rx class for
StringType. - RxNum
- A reactive wrapper for non-nullable num values with arithmetic operators.
-
RxSet<
E> - RxString
-
Rx class for
StringType. -
SetEquality<
E> - Equality of sets.
-
StateController<
T> - A controller that manages state for asynchronous operations.
-
SuccessStatus<
T> -
SuperController<
T> - A controller that combines full lifecycle management with state management.
-
UnorderedIterableEquality<
E> - Equality of the elements of two iterables without considering order.
-
Value<
T> -
ValueBuilder<
T> - Manages a local state like ObxValue, but uses a callback instead of a Rx value.
-
ValueBuilderState<
T> - Worker
- Manages cancellation of a stream subscription and tracks disposal status.
- Workers
- Manages disposal of a list of active Worker instances.
Enums
- SmartManagement
- GetX by default disposes unused controllers from memory, Through different behaviors. SmartManagement.full SmartManagement.full is the default one. Dispose classes that are not being used and were not set to be permanent. In the majority of the cases you will want to keep this config untouched. If you new to GetX then don't change this. SmartManagement.onlyBuilder only controllers started in init: or loaded into a Binding with Get.lazyPut() will be disposed. If you use Get.put() or Get.putAsync() or any other approach, SmartManagement will not have permissions to exclude this dependency. With the default behavior, even widgets instantiated with "Get.put" will be removed, unlike SmartManagement.onlyBuilders. SmartManagement.keepFactoryJust like SmartManagement.full, it will remove it's dependencies when it's not being used anymore. However, it will keep their factory, which means it will recreate the dependency if you need that instance again.
Mixins
- Equality
- FullLifeCycleMixin
- A mixin that provides full lifecycle callbacks for the controller.
- GetLifeCycleMixin
-
The
GetLifeCycle - GetSingleTickerProviderStateMixin
-
Used like
SingleTickerProviderMixinbut only with Get Controllers. Simplifies AnimationController creation inside GetxController. - GetTickerProviderStateMixin
-
Used like
TickerProviderMixinbut only with Get Controllers. Simplifies multiple AnimationController creation inside GetxController. -
RxObjectMixin<
T> -
global object that registers against
GetXandObx, and allows the reactivity of thoseWidgetsand Rx values. A mixin that provides reactive (Rx) object behavior for any typeT. - ScrollMixin
- A mixin that provides scroll-based data fetching capabilities.
- SingleGetTickerProviderMixin
-
Used like
SingleTickerProviderMixinbut only with Get Controllers. Simplifies AnimationController creation inside GetxController. - StatelessOblObserverComponent
-
Component that sets up Notifier tracking and invokes the single
effectwhen observables change. - StatelessObserverComponent
- a Component that can track changes in a reactive variable
-
StateMixin<
T>
Extensions
- BoolExtension on bool
- Convenience extension to make any bool reactive.
- DoubleExtension on double
- Convenience extension to make any double reactive.
- GetResetExt on GetInterface
- Inst on GetInterface
- Extension on GetInterface that provides dependency injection methods.
- IntExtension on int
- Convenience extension to make any int reactive.
-
ListExtension
on List<
E> - LoopEventsExt on GetInterface
-
MapExtension
on Map<
K, V> - ResetInstance on GetInterface
-
RxBoolExt
on Rx<
bool> - Reactive extensions for Rx<bool>.
-
RxDoubleExt
on Rx<
double> - Reactive extensions for non-nullable double values.
-
RxIntExt
on Rx<
int> -
RxnBoolExt
on Rx<
bool?> - Reactive extensions for Rx<bool?>.
-
RxnDoubleExt
on Rx<
double?> - Reactive extensions for nullable double values.
-
RxnIntExt
on Rx<
int?> -
RxnNumExt
on Rx<
T?> - Reactive extensions for nullable num types.
-
RxnStringExt
on Rx<
String?> - Reactive extensions for nullable String values.
-
RxNumExt
on Rx<
T> - Reactive extensions for non-nullable num types.
-
RxStringExt
on Rx<
String> - Reactive extensions for non-nullable String values.
- RxT on T
-
Convenience extension to make any Object reactive as
Rx<T>. - RxTnew on Object
-
This method will replace the old
.obsmethod. It's a breaking change, but it is essential to avoid conflicts with the new dart 3 features. T will be inferred by contextual type inference rather than the extension type. -
SetExtension
on Set<
E> -
StateExt
on StateMixin<
T> -
StatusDataExt
on GetStatus<
T> - StringExtension on String
- Convenience extension to make any String reactive.
Properties
- Get → _GetImpl
-
final
Functions
-
debounce<
T> (GetListenable< T> listener, WorkerCallback<T> callback, {Duration? time, Function? onError, void onDone()?, bool? cancelOnError}) → Worker -
debounce is similar to interval, but sends the last value.
Useful for Anti DDos, every time the user stops typing for 1 second,
for instance.
When
listeneremits the last "value", whentimehits, it callscallbackwith the last "value" emitted. -
defaultLogWriterCallback(
String value, {bool isError = false}) → void - default logger from GetX
-
ever<
T> (GetListenable< T> listener, WorkerCallback<T> callback, {Object? condition = true, Function? onError, void onDone()?, bool? cancelOnError}) → Worker -
Called every time
listenerchanges. As long as theconditionreturns true. -
everAll(
List< RxInterface> listeners, WorkerCallback callback, {Object? condition = true, Function? onError, void onDone()?, bool? cancelOnError}) → Worker -
Similar to ever, but takes a list of
listeners, the condition for thecallbackis common to alllisteners, and thecallbackis executed to each one of them. The Worker is common to all, soworker.dispose()will cancel all streams. -
interval<
T> (GetListenable< T> listener, WorkerCallback<T> callback, {Duration time = const Duration(seconds: 1), Object? condition = true, Function? onError, void onDone()?, bool? cancelOnError}) → Worker -
Ignore all changes in
listenerduringtime(1 sec by default) or untilconditionis met (can be a bool expression or abool Function()), It brings the 1st "value" since the period of time, so if you click a counter button 3 times in 1 sec, it will show you "1" (after 1 sec of the first press) click counter 3 times in 1 sec, it will show you "4" (after 1 sec) click counter 2 times in 1 sec, it will show you "7" (after 1 sec). -
once<
T> (GetListenable< T> listener, WorkerCallback<T> callback, {Object? condition = true, Function? onError, void onDone()?, bool? cancelOnError}) → Worker -
once()will execute only 1 time whenconditionis met and cancel the subscription to thelistenerstream right after that.conditiondefines whencallbackis called, and can be a bool or abool Function().
Typedefs
-
AsyncInstanceBuilderCallback<
S> = Future< S> Function() -
An asynchronous factory callback that returns a Future of type
S. - EffectCallback = void Function()
-
FuturizeCallback<
T> = Future< T> Function(VoidCallback fn) -
GetControllerBuilder<
T extends GetLifeCycleMixin> = Widget Function(T controller) - A builder function that receives a GetLifeCycleMixin controller and returns a Widget.
-
GetXControllerBuilder<
T extends GetLifeCycleMixin> = Widget Function(T controller) -
InitBuilder<
T> = T Function() -
A factory function that returns an instance of type
T. -
InstanceBuilderCallback<
S> = S Function() -
A synchronous factory callback that returns an instance of type
S. -
InstanceCreateBuilderCallback<
S> = S Function(BuildContext _) -
A factory callback that receives a BuildContext and returns an instance of
S. - LogWriterCallback = void Function(String text, {bool isError})
- VoidCallback from logs
-
NotifierBuilder<
T> = Widget Function(T state) -
ValueBuilderBuilder<
T> = Widget Function(T snapshot, ValueBuilderUpdateCallback< T> updater) -
ValueBuilderUpdateCallback<
T> = void Function(T snapshot) -
ValueUpdater<
T> = T Function() -
A callback that returns an updated value of type
T. - VoidCallback = void Function()
- WidgetCallback = Widget Function()
- A callback that returns a Widget with no parameters.
-
WorkerCallback<
T> = dynamic Function(T callback)