flutter_debouncing_controllers 0.1.2 copy "flutter_debouncing_controllers: ^0.1.2" to clipboard
flutter_debouncing_controllers: ^0.1.2 copied to clipboard

Debouncing variants of flutter controllers and notifiers. Nearly DROP-IN replacements!

flutter_debouncing_controllers #

Debouncing variants of flutter controllers and notifiers. Nearly DROP-IN replacements!

/// before:
final textController = TextController()
  ..addListener(_onTextChange);

TextField(controller: textController);

/// after:
final debouncingController = DebouncingTextController(duration: Duration(seconds: 2))
  ..addListener(_onTextChange);

TextField(controller: debouncingController.textController);
/// before:
final searchController = SearchController()
  ..addListener(_onSearchChange);

SearchAnchor.bar(searchController: searchController, ...);

/// after:
final debouncingController = DebouncingSearchController() // 300 ms by default
  ..addListener(_onSearchChange);

SearchAnchor.bar(searchController: debouncingController.searchController, ...);

Useful debouncing versions of notifiers:

final debouncingNotifier = DebouncingChangeNotifier() // 300 ms by default
  ..addListener(_onChange);

/// [_onChange] is called only once.
debouncingNotifier.change();
debouncingNotifier.change();
debouncingNotifier.change();

final debouncingNotifier = DebouncingValueNotifier(1) // 300 ms by default
  ..addListener(_onChange);

/// [_onChange] is called only once.
debouncingNotifier.value = 2;
debouncingNotifier.value = 3;
debouncingNotifier.value = 4;
6
likes
160
points
299
downloads

Publisher

verified publisheroquad.ru

Weekly Downloads

Debouncing variants of flutter controllers and notifiers. Nearly DROP-IN replacements!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_debouncing_controllers