Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 691 Bytes

useBuildsCount.md

File metadata and controls

34 lines (27 loc) · 691 Bytes

useBuildsCount

Tracks component's builds count including the first build.

Installation

dependencies:
  flutter_use: ^0.0.2

Usage

class Sample extends HookWidget {
  @override
  Widget build(BuildContext context) {
    final buildsCount = useBuildsCount();
    final update = useUpdate();

    return Column(
      children: [
        Text("Builds count: $buildsCount"),
        ElevatedButton(
          onPressed: () => update(),
          child: const Text('Rebuild'),
        ),
      ]
    );
  }
}