singleton_button

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

singleton button

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");
}
}
copied to clipboard
Additional information #
MIT license.
-Erhannis

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.