speed_up_get 0.0.1 speed_up_get: ^0.0.1 copied to clipboard
Package to speed up GetX.
The package extends functionality for GetX.
Features #
- Short reference to controller
- Unsubscribe a subscriptions automatically
Getting started #
Add dependency
dependencies:
speed_up_get: latest
Usage #
Reference to a Controller #
Now you can reference to controller in the View(Widget) with short c
reference
Scaffold(
appBar: AppBar(
title: Text(c.title),
),
body: Center(
child: Obx(
() => Text(
'${c.counter}',
style: Theme.of(context).textTheme.headline4,
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: c.incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
Subscribing #
Subscribe in onInit
of Services or Controllers and forget to unsubscribe in onClose
@override
void onInit() {
subscribe(Stream.values([1, 2, 3]), onValue: (value) => print(value));
}
@override
void onClose() {
// TODO: No need unsubscribe
super.onClose();
}
Longer examples to /example
folder.
Contributing #
We accept the following contributions:
- Improving documentation
- Reporting issues
- Fixing bugs