Move examples to ListenableBuilder (#130671)
Updates examples to use the new `ListenableBuilder` if there's no animation. This is slightly more idiomatic.
This commit is contained in:
@@ -74,8 +74,8 @@ class _MyKeyExampleState extends State<MyKeyExample> {
|
||||
child: Focus(
|
||||
focusNode: _focusNode,
|
||||
onKey: _handleKeyEvent,
|
||||
child: AnimatedBuilder(
|
||||
animation: _focusNode,
|
||||
child: ListenableBuilder(
|
||||
listenable: _focusNode,
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
if (!_focusNode.hasFocus) {
|
||||
return GestureDetector(
|
||||
|
||||
@@ -74,8 +74,8 @@ class _MyPhysicalKeyExampleState extends State<MyPhysicalKeyExample> {
|
||||
child: Focus(
|
||||
focusNode: _focusNode,
|
||||
onKey: _handleKeyEvent,
|
||||
child: AnimatedBuilder(
|
||||
animation: _focusNode,
|
||||
child: ListenableBuilder(
|
||||
listenable: _focusNode,
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
if (!_focusNode.hasFocus) {
|
||||
return GestureDetector(
|
||||
|
||||
Reference in New Issue
Block a user