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

Debouncing controllers and notifiers

flutter_debouncing_controllers #

Debouncing variants of flutter controllers and notifiers.

Controllers that are intended to be nearly drop-in replacements:

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

TextField(controller: textController);

/// after:
final debouncingController = DebouncingTextController()
  ..addListener(_onTextChange);

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

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

/// after:
final debouncingController = DebouncingSearchController()
  ..addListener(_onSearchChange);

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

Useful debouncing versions of notifiers:

final debouncingNotifier = DebouncingChangeNotifier()
  ..addListener(_onChange);

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

final debouncingNotifier = DebouncingValueNotifier(1)
  ..addListener(_onChange);

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

Publisher

verified publisheroquad.ru

Weekly Downloads

Debouncing controllers and notifiers

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_debouncing_controllers