Skip to content

Commit acf9bf1

Browse files
committed
fix: export less
1 parent 6000189 commit acf9bf1

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

lib/src/theme.dart

+11-13
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ import 'package:flutter/material.dart';
66
import 'color_x.dart';
77
import 'theme_data_x.dart';
88

9+
bool get _isMobile =>
10+
!kIsWeb && (Platform.isAndroid || Platform.isIOS || Platform.isFuchsia);
11+
912
typedef ThemePair = ({ThemeData lightTheme, ThemeData darkTheme});
1013

1114
const _lightBase = Colors.white;
1215
final _darkBase = Colors.black.scale(lightness: 0.09);
1316
final _darkMenuBase = Colors.black.scale(lightness: 0.07);
1417
const _kContainerRadius = 10.0;
15-
const kDesktopButtonHeight = 42.0;
16-
const kMobileButtonHeight = 48.0;
17-
final _kButtonHeight = isDesktop ? kDesktopButtonHeight : kMobileButtonHeight;
18+
const _kDesktopButtonHeight = 42.0;
19+
const _kMobileButtonHeight = 48.0;
20+
final _kButtonHeight = _isMobile ? _kMobileButtonHeight : _kDesktopButtonHeight;
1821
final _kButtonRadius = _kButtonHeight / 2;
1922
const _kMenuRadius = 8.0;
2023
const _kInputDecorationRadius = 6.0;
2124
const _kDesktopIconSize = 20.0;
2225
const _kMobileIconSize = 24.0;
23-
final _iconSize = isMobile ? _kMobileIconSize : _kDesktopIconSize;
26+
final _iconSize = _isMobile ? _kMobileIconSize : _kDesktopIconSize;
2427

2528
ThemePair phoenixTheme({
2629
required Color color,
@@ -246,7 +249,7 @@ SliderThemeData _sliderTheme(ColorScheme colorScheme) {
246249

247250
InputDecorationTheme _inputDecorationTheme(ColorScheme colorScheme) {
248251
return InputDecorationTheme(
249-
isDense: isDesktop ? true : false,
252+
isDense: _isMobile ? false : true,
250253
filled: true,
251254
fillColor: colorScheme.surface
252255
.scale(lightness: colorScheme.isLight ? -0.07 : 0.03),
@@ -445,8 +448,9 @@ IconButtonThemeData _iconButtonTheme({
445448
return IconButtonThemeData(
446449
style: IconButton.styleFrom(
447450
minimumSize: buttonSize,
448-
padding: buttonSize.height < kMobileButtonHeight ? EdgeInsets.zero : null,
449-
visualDensity: buttonSize.height < kMobileButtonHeight
451+
padding:
452+
buttonSize.height < _kMobileButtonHeight ? EdgeInsets.zero : null,
453+
visualDensity: buttonSize.height < _kMobileButtonHeight
450454
? VisualDensity.compact
451455
: null,
452456
).copyWith(
@@ -514,9 +518,3 @@ SnackBarThemeData _snackBarThemeData(ColorScheme colorScheme) {
514518
),
515519
);
516520
}
517-
518-
bool get isMobile =>
519-
!kIsWeb && (Platform.isAndroid || Platform.isIOS || Platform.isFuchsia);
520-
521-
bool get isDesktop =>
522-
!kIsWeb && (Platform.isLinux || Platform.isMacOS || Platform.isWindows);

0 commit comments

Comments
 (0)