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

Singleton button for quick hacks and tests involving disparate parts of a program and you can't be bothered to wire it up "right".

Singleton button for quick hacks and tests involving disparate parts of a program and you can't be bothered to wire it up "right".

Features #

Address button states via global strings. Check if button's been pressed since last time you checked.

Usage #

void testBuild() {
  SingletonButton("no callback", child: Text("no callback"));
  SingletonButton("yes callback", child: Text("yes callback"), onPressed: () {
    log("declaration callback hit");
  },);
}

void test() {
  // Somewhere else, maybe asynchronous
  if (SingletonButton.get("no callback").qHasBeenClicked()) {
    log("no-callback was clicked since last time");
  }
  if (SingletonButton.get("yes callback").qHasBeenClicked()) {
    log("yes-callback was clicked since last time");
  }
}

Additional information #

MIT license.

-Erhannis

0
likes
140
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

Singleton button for quick hacks and tests involving disparate parts of a program and you can't be bothered to wire it up "right".

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on singleton_button