forked from firka/flutter
Text field focus and hover support. (#32776)
This adds support for an animated focusColor and hoverColor to InputDecorator. This color will blend with the background over a fade in period whenever the InputDecorator is focused or hovered, respectively. It also adds a Listener to the TextField to listen for hover events.
This commit is contained in:
@@ -57,20 +57,24 @@ class _HoverDemoState extends State<HoverDemo> {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => print('Button pressed'),
|
||||
icon: const Icon(Icons.access_alarm),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
Row(
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => print('Button pressed'),
|
||||
icon: const Icon(Icons.access_alarm),
|
||||
focusColor: Colors.deepOrangeAccent,
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
||||
Reference in New Issue
Block a user