ButtonTheme.bar constructor

  1. @Deprecated('Use ButtonBarTheme instead. ' 'This feature was deprecated after v1.9.1.')
ButtonTheme.bar(
  1. {Key key,
  2. ButtonTextTheme textTheme: ButtonTextTheme.accent,
  3. double minWidth: 64.0,
  4. double height: 36.0,
  5. EdgeInsetsGeometry padding: const EdgeInsets.symmetric(horizontal: 8.0),
  6. ShapeBorder shape,
  7. bool alignedDropdown: false,
  8. Color buttonColor,
  9. Color disabledColor,
  10. Color focusColor,
  11. Color hoverColor,
  12. Color highlightColor,
  13. Color splashColor,
  14. ColorScheme colorScheme,
  15. Widget child,
  16. ButtonBarLayoutBehavior layoutBehavior: ButtonBarLayoutBehavior.padded}
)

Creates a button theme that is appropriate for button bars, as used in dialog footers and in the headers of data tables.

Deprecated. Please use ButtonBarTheme instead which offers more flexibility to configure ButtonBar widgets.

To migrate instances of code that were just wrapping a ButtonBar:

ButtonTheme.bar(
  child: ButtonBar(...)
);

you can just remove the ButtonTheme.bar as the defaults are now handled by ButtonBar directly.

If you have more complicated usages of ButtonTheme.bar like:

ButtonTheme.bar(
  padding: EdgeInsets.symmetric(horizontal: 10.0),
  textTheme: ButtonTextTheme.accent,
  child: ButtonBar(...),
);

you can remove the ButtonTheme.bar and move the parameters to the ButtonBar instance directly:

ButtonBar(
  padding: EdgeInsets.symmetric(horizontal: 10.0),
  textTheme: ButtonTextTheme.accent,
  ...
);

You can also replace the defaults for all ButtonBar widgets by updating ThemeData.buttonBarTheme for your app.

Implementation

@Deprecated(
  'Use ButtonBarTheme instead. '
  'This feature was deprecated after v1.9.1.'
)
ButtonTheme.bar({
  Key key,
  ButtonTextTheme textTheme = ButtonTextTheme.accent,
  double minWidth = 64.0,
  double height = 36.0,
  EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8.0),
  ShapeBorder shape,
  bool alignedDropdown = false,
  Color buttonColor,
  Color disabledColor,
  Color focusColor,
  Color hoverColor,
  Color highlightColor,
  Color splashColor,
  ColorScheme colorScheme,
  Widget child,
  ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,
}) : assert(textTheme != null),
     assert(minWidth != null && minWidth >= 0.0),
     assert(height != null && height >= 0.0),
     assert(alignedDropdown != null),
     data = ButtonThemeData(
       textTheme: textTheme,
       minWidth: minWidth,
       height: height,
       padding: padding,
       shape: shape,
       alignedDropdown: alignedDropdown,
       layoutBehavior: layoutBehavior,
       buttonColor: buttonColor,
       disabledColor: disabledColor,
       focusColor: focusColor,
       hoverColor: hoverColor,
       highlightColor: highlightColor,
       splashColor: splashColor,
       colorScheme: colorScheme,
     ),
     super(key: key, child: child);