@@ -12,7 +12,9 @@ const _lightBase = Colors.white;
1212final _darkBase = Colors .black.scale (lightness: 0.09 );
1313final _darkMenuBase = Colors .black.scale (lightness: 0.07 );
1414const _kContainerRadius = 10.0 ;
15- final _kButtonHeight = isDesktop ? 42.0 : 48.0 ;
15+ const kDesktopButtonHeight = 42.0 ;
16+ const kMobileButtonHeight = 48.0 ;
17+ final _kButtonHeight = isDesktop ? kDesktopButtonHeight : kMobileButtonHeight;
1618final _kButtonRadius = _kButtonHeight / 2 ;
1719const _kMenuRadius = 8.0 ;
1820const _kInputDecorationRadius = 6.0 ;
@@ -48,7 +50,8 @@ ThemeData _phoenixTheme({
4850 borderRadius: BorderRadius .circular (buttonRadius ?? _kButtonRadius),
4951 );
5052
51- final buttonSize = Size (1 , buttonHeight ?? _kButtonHeight);
53+ final buttonSize =
54+ Size (buttonHeight ?? _kButtonHeight, buttonHeight ?? _kButtonHeight);
5255
5356 return ThemeData (
5457 colorScheme: colorScheme,
@@ -87,6 +90,10 @@ ThemeData _phoenixTheme({
8790 buttonShape: buttonShape,
8891 buttonSize: buttonSize,
8992 ),
93+ iconButtonTheme: _iconButtonTheme (
94+ colorScheme: colorScheme,
95+ buttonSize: buttonSize,
96+ ),
9097 navigationRailTheme: _naviRailTheme (colorScheme),
9198 navigationBarTheme: _naviBarTheme (colorScheme),
9299 appBarTheme: _appBarTheme (colorScheme),
@@ -424,6 +431,32 @@ TextButtonThemeData _textButtonThemeData({
424431 );
425432}
426433
434+ IconButtonThemeData _iconButtonTheme ({
435+ required ColorScheme colorScheme,
436+ required Size buttonSize,
437+ }) {
438+ return IconButtonThemeData (
439+ style: IconButton .styleFrom (
440+ minimumSize: buttonSize,
441+ padding: buttonSize.height < kMobileButtonHeight ? EdgeInsets .zero : null ,
442+ visualDensity: buttonSize.height < kMobileButtonHeight
443+ ? VisualDensity .compact
444+ : null ,
445+ ).copyWith (
446+ iconColor: WidgetStateProperty .resolveWith (
447+ (s) => s.contains (WidgetState .disabled)
448+ ? colorScheme.onSurface.withOpacity (0.7 )
449+ : colorScheme.onSurface,
450+ ),
451+ backgroundColor: WidgetStateProperty .resolveWith (
452+ (s) => s.contains (WidgetState .selected)
453+ ? colorScheme.onSurface.withOpacity (0.1 )
454+ : Colors .transparent,
455+ ),
456+ ),
457+ );
458+ }
459+
427460NavigationRailThemeData _naviRailTheme (ColorScheme colorScheme) {
428461 return NavigationRailThemeData (
429462 indicatorColor: _indicatorColor (colorScheme),
0 commit comments