speed_up_get 0.0.1 copy "speed_up_get: ^0.0.1" to clipboard
speed_up_get: ^0.0.1 copied to clipboard

outdated

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

Maintainers #

3
likes
0
pub points
83%
popularity

Publisher

unverified uploader

Package to speed up GetX.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, get

More

Packages that depend on speed_up_get