Unverified Commit e86caf7a authored by Hans Muller's avatar Hans Muller Committed by GitHub

Updated use of OutlineButton in FocusTraversalPolicy API doc (#63236)

parent f1bf6cf9
...@@ -1528,15 +1528,34 @@ class FocusTraversalOrder extends InheritedWidget { ...@@ -1528,15 +1528,34 @@ class FocusTraversalOrder extends InheritedWidget {
/// order = LexicalFocusOrder(widget.order.toString()); /// order = LexicalFocusOrder(widget.order.toString());
/// } /// }
/// ///
/// Color overlayColor(Set<MaterialState> states) {
/// if (states.contains(MaterialState.focused)) {
/// return Colors.red;
/// }
/// if (states.contains(MaterialState.hovered)) {
/// return Colors.blue;
/// }
/// return null; // defer to the default overlayColor
/// }
///
/// Color foregroundColor(Set<MaterialState> states) {
/// if (states.contains(MaterialState.focused) || states.contains(MaterialState.hovered)) {
/// return Colors.white;
/// }
/// return null; // defer to the default foregroundColor
/// }
///
/// return FocusTraversalOrder( /// return FocusTraversalOrder(
/// order: order, /// order: order,
/// child: Padding( /// child: Padding(
/// padding: const EdgeInsets.all(8.0), /// padding: const EdgeInsets.all(8.0),
/// child: OutlineButton( /// child: OutlinedButton(
/// focusNode: focusNode, /// focusNode: focusNode,
/// autofocus: widget.autofocus, /// autofocus: widget.autofocus,
/// focusColor: Colors.red, /// style: ButtonStyle(
/// hoverColor: Colors.blue, /// overlayColor: MaterialStateProperty.resolveWith<Color>(overlayColor),
/// foregroundColor: MaterialStateProperty.resolveWith<Color>(foregroundColor),
/// ),
/// onPressed: () => _handleOnPressed(), /// onPressed: () => _handleOnPressed(),
/// child: Text(widget.name), /// child: Text(widget.name),
/// ), /// ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment