@@ -112,12 +112,12 @@ class IconLabelButton extends StatelessWidget {
112112 includeTextWidth: includeTextWidth,
113113 );
114114 if (elevatedButton) {
115- return FixedHeightElevatedButton (
115+ return ElevatedButton (
116116 onPressed: onPressed,
117117 child: iconLabel,
118118 );
119119 }
120- return FixedHeightOutlinedButton (
120+ return OutlinedButton (
121121 onPressed: onPressed,
122122 child: iconLabel,
123123 );
@@ -258,13 +258,17 @@ class SettingsOutlinedButton extends StatelessWidget {
258258
259259 @override
260260 Widget build (BuildContext context) {
261- return FixedHeightOutlinedButton (
261+ return SizedBox (
262262 width: defaultButtonHeight, // This will result in a square button.
263- onPressed: onPressed,
264- tooltip: tooltip,
265- child: const Icon (
266- Icons .settings,
267- size: defaultIconSize,
263+ child: DevToolsTooltip (
264+ tooltip: tooltip,
265+ child: OutlinedButton (
266+ onPressed: onPressed,
267+ child: const Icon (
268+ Icons .settings,
269+ size: defaultIconSize,
270+ ),
271+ ),
268272 ),
269273 );
270274 }
@@ -298,7 +302,7 @@ class ExpandAllButton extends StatelessWidget {
298302
299303 @override
300304 Widget build (BuildContext context) {
301- return FixedHeightOutlinedButton (
305+ return OutlinedButton (
302306 onPressed: onPressed,
303307 child: const Text ('Expand All' ),
304308 );
@@ -313,93 +317,13 @@ class CollapseAllButton extends StatelessWidget {
313317
314318 @override
315319 Widget build (BuildContext context) {
316- return FixedHeightOutlinedButton (
320+ return OutlinedButton (
317321 onPressed: onPressed,
318322 child: const Text ('Collapse All' ),
319323 );
320324 }
321325}
322326
323- // TODO(kenz): remove use of this class once we can specify a fixed button
324- // height in the theme. See https://github.com/flutter/flutter/issues/73741.
325- class FixedHeightOutlinedButton extends StatelessWidget {
326- const FixedHeightOutlinedButton ({
327- this .buttonKey,
328- @required this .onPressed,
329- @required this .child,
330- this .autofocus = false ,
331- this .style,
332- this .width,
333- this .tooltip,
334- });
335-
336- final Key buttonKey;
337-
338- final VoidCallback onPressed;
339-
340- final Widget child;
341-
342- final bool autofocus;
343-
344- final ButtonStyle style;
345-
346- final double width;
347-
348- final String tooltip;
349-
350- @override
351- Widget build (BuildContext context) {
352- final button = SizedBox (
353- height: defaultButtonHeight,
354- width: width,
355- child: OutlinedButton (
356- key: buttonKey,
357- style: style,
358- autofocus: autofocus,
359- onPressed: onPressed,
360- child: child,
361- ),
362- );
363- if (tooltip != null ) {
364- return Tooltip (
365- message: tooltip,
366- preferBelow: false ,
367- waitDuration: tooltipWait,
368- child: button,
369- );
370- }
371- return button;
372- }
373- }
374-
375- // TODO(kenz): remove use of this class once we can specify a fixed button
376- // height in the theme. See https://github.com/flutter/flutter/issues/73741.
377- class FixedHeightElevatedButton extends StatelessWidget {
378- const FixedHeightElevatedButton ({
379- @required this .child,
380- @required this .onPressed,
381- this .style,
382- });
383-
384- final Widget child;
385-
386- final VoidCallback onPressed;
387-
388- final ButtonStyle style;
389-
390- @override
391- Widget build (BuildContext context) {
392- return SizedBox (
393- height: defaultButtonHeight,
394- child: ElevatedButton (
395- style: style,
396- onPressed: onPressed,
397- child: child,
398- ),
399- );
400- }
401- }
402-
403327class RecordingInfo extends StatelessWidget {
404328 const RecordingInfo ({
405329 this .instructionsKey,
@@ -573,8 +497,8 @@ class ExitOfflineButton extends StatelessWidget {
573497
574498 @override
575499 Widget build (BuildContext context) {
576- return FixedHeightOutlinedButton (
577- buttonKey : const Key ('exit offline button' ),
500+ return OutlinedButton (
501+ key : const Key ('exit offline button' ),
578502 onPressed: onPressed,
579503 child: const MaterialIconLabel (
580504 label: 'Exit offline mode' ,
@@ -841,21 +765,23 @@ class FilterButton extends StatelessWidget {
841765 @override
842766 Widget build (BuildContext context) {
843767 final theme = Theme .of (context);
844- return FixedHeightOutlinedButton (
845- buttonKey: key,
768+ return DevToolsTooltip (
846769 tooltip: 'Filter' ,
847- onPressed: onPressed,
848- style: TextButton .styleFrom (
849- backgroundColor: isFilterActive
850- ? theme.colorScheme.toggleButtonBackgroundColor
851- : Colors .transparent,
852- ),
853- child: Icon (
854- Icons .filter_list,
855- size: defaultIconSize,
856- color: isFilterActive
857- ? theme.colorScheme.toggleButtonForegroundColor
858- : theme.colorScheme.contrastForeground,
770+ child: OutlinedButton (
771+ key: key,
772+ onPressed: onPressed,
773+ style: TextButton .styleFrom (
774+ backgroundColor: isFilterActive
775+ ? theme.colorScheme.toggleButtonBackgroundColor
776+ : Colors .transparent,
777+ ),
778+ child: Icon (
779+ Icons .filter_list,
780+ size: defaultIconSize,
781+ color: isFilterActive
782+ ? theme.colorScheme.toggleButtonForegroundColor
783+ : theme.colorScheme.contrastForeground,
784+ ),
859785 ),
860786 );
861787 }
0 commit comments