rrousselGit / flutter_hooks

React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
MIT License
3.13k stars 179 forks source link

add `useFocusScopeNode` hook #317

Closed iamsahilsonawane closed 1 year ago

iamsahilsonawane commented 2 years ago

Added focus scope node for FocusScope widget.

class Example extends HookWidget {
  @override
  Widget build(BuildContext context) {
   final node = useFocusScopeNode();
   return FocusScope(autofocus: true, node: node, child: ...);        
  }
}

Fixes #316

codecov[bot] commented 1 year ago

Codecov Report

Base: 99.86% // Head: 99.86% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (bbf030a) compared to base (99738db). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #317 +/- ## ======================================= Coverage 99.86% 99.86% ======================================= Files 16 17 +1 Lines 741 765 +24 ======================================= + Hits 740 764 +24 Misses 1 1 ``` | [Impacted Files](https://codecov.io/gh/rrousselGit/flutter_hooks/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet) | Coverage Δ | | |---|---|---| | [packages/flutter\_hooks/lib/src/focus\_node.dart](https://codecov.io/gh/rrousselGit/flutter_hooks/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvZmx1dHRlcl9ob29rcy9saWIvc3JjL2ZvY3VzX25vZGUuZGFydA==) | `100.00% <ø> (ø)` | | | [...ckages/flutter\_hooks/lib/src/focus\_scope\_node.dart](https://codecov.io/gh/rrousselGit/flutter_hooks/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvZmx1dHRlcl9ob29rcy9saWIvc3JjL2ZvY3VzX3Njb3BlX25vZGUuZGFydA==) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.