obx 0.0.2 copy "obx: ^0.0.2" to clipboard
obx: ^0.0.2 copied to clipboard

discontinued
outdated

obx is tiny\fast\simple state manage.

Obx #

Obx is tiny \ fast \ simple state manage.

  • Obx not need Provider at root Widget.
  • Obx use memo to intercept update, like react.Hooks.
  • Obx is tiny and ease use, only 2 API:
    • ob
    • next

All in the picture #

Definition class User in user.dart:

Import user.dart:

Overall interpretation #

Instance a user,extends Obx:

// Definition Obx
class User extends Obx {
  String name = "dog";
}

// Instance, use some widgets
var user = User();

Subscribe and return a weight:

user.ob(()=>Text(user.name))

Submit and update user.ob's subscribe:

user.next()

Install Obx #

Change pubspec.yaml:

dependencies:
  obx:

Better performance #

Use memo options params, like React.useMemo, only rerender data in memo array.

Example only rerender when user.name change:

user.ob(
  () => Text(user.name), 
  memo: ()=>[user.name],
);

That all, keep sample :)

2
likes
0
pub points
32%
popularity

Publisher

unverified uploader

obx is tiny\fast\simple state manage.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on obx