improve focus example (#147464)
Part of #130459. Adds a test to the [second focus example](https://api.flutter.dev/flutter/widgets/Focus-class.html#widgets.Focus.2) and makes the function of the example more clear.
This commit is contained in:
@@ -47,7 +47,7 @@ class FocusableText extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
// Change the color based on whether or not this Container has focus.
|
||||
color: Focus.of(context).hasPrimaryFocus ? Colors.black12 : null,
|
||||
color: Focus.of(context).hasPrimaryFocus ? Colors.red : Colors.white,
|
||||
child: Text(data),
|
||||
);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user