Current Time 0:00
Duration Time 0:00
Progress: NaN%
Playback Rate
Closed Caption

Flutter Hooks -- useState


About Flutter Hooks

Flutter Hooks was created by Remi Rousselet.

Hooks are a new kind of object that manages a Widget life-cycles. They exist for one reason: increase the code sharing between widgets and as a complete replacement for StatefulWidget. -- Remi Rousselet

In case you want to dive into knowing more about Hooks implementation (React), you can read this great article by Rudi Yardley,


  1. Add Flutter Hooks to Pubspec
flutter_hooks: ^0.6.1
  1. Import the package
import 'package:flutter_hooks/flutter_hooks.dart';
  1. Add your state for counter
final counter = useState(0);
  1. Consume State
  1. Change State
onPressed: () => counter.value++


Loading comments...