Flutter lifecycle hook that console logs parameters as component transitions through lifecycles.
dependencies:
flutter_use: ^0.0.2
class Sample extends HookWidget {
const Sample(this.user, {Key? key}) : super(key: key);
final Map<String, dynamic> user;
@override
Widget build(BuildContext context) {
useLogger('Sample', props: user);
return Container();
}
}
Sample mounted {}
Sample updated {}
Sample unmounted
useLogger(componentName: string, props: map);
componentName
: String
- component name.props
: Map<String, dynamic>
- parameters to log.