mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 11:53:41 +00:00
fix: create task panel mobile UI (#1488)
This commit is contained in:
36 files changed
+869
-827
No files matched your search
@@ -18,42 +18,50 @@ class AppComponentThemes extends StatelessWidget {
|
||||
align: 1,
|
||||
border: Border.all(color: theme.colorScheme.ring.withValues(alpha: 0.65), width: 1),
|
||||
),
|
||||
child: shad.ComponentTheme<shad.SecondaryButtonTheme>(
|
||||
data: shad.SecondaryButtonTheme(
|
||||
decoration: (context, states, value) {
|
||||
final decoration = switch (value) {
|
||||
final BoxDecoration decoration => decoration,
|
||||
_ => BoxDecoration(borderRadius: BorderRadius.circular(theme.radiusMd)),
|
||||
};
|
||||
if (states.contains(WidgetState.disabled)) {
|
||||
return decoration.copyWith(color: palette.surfaceSoft);
|
||||
}
|
||||
if (theme.brightness == Brightness.light) {
|
||||
final background = Color.alphaBlend(palette.textPrimary.withValues(alpha: 0.08), palette.surfaceSoft);
|
||||
final hoverBackground = Color.alphaBlend(
|
||||
palette.textPrimary.withValues(alpha: 0.13),
|
||||
palette.surfaceSoft,
|
||||
);
|
||||
return decoration.copyWith(color: states.contains(WidgetState.hovered) ? hoverBackground : background);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
textStyle: (context, states, value) => states.contains(WidgetState.disabled)
|
||||
? value.copyWith(color: palette.textMuted.withValues(alpha: 0.62))
|
||||
: value,
|
||||
iconTheme: (context, states, value) => states.contains(WidgetState.disabled)
|
||||
? value.copyWith(color: palette.textMuted.withValues(alpha: 0.62))
|
||||
: value,
|
||||
child: shad.ComponentTheme<shad.TextFieldTheme>(
|
||||
data: shad.TextFieldTheme(
|
||||
filled: true,
|
||||
border: Border.all(color: palette.border),
|
||||
borderRadius: BorderRadius.circular(AppDesignTokens.controlRadius),
|
||||
padding: AppDesignTokens.textFieldPadding,
|
||||
),
|
||||
child: shad.ComponentTheme<shad.CheckboxTheme>(
|
||||
data: shad.CheckboxTheme(
|
||||
size: AppDesignTokens.checkboxSize,
|
||||
gap: AppDesignTokens.checkboxLabelGap,
|
||||
borderColor: theme.brightness == Brightness.dark ? palette.textMuted : palette.border,
|
||||
child: shad.ComponentTheme<shad.SecondaryButtonTheme>(
|
||||
data: shad.SecondaryButtonTheme(
|
||||
decoration: (context, states, value) {
|
||||
final decoration = switch (value) {
|
||||
final BoxDecoration decoration => decoration,
|
||||
_ => BoxDecoration(borderRadius: BorderRadius.circular(theme.radiusMd)),
|
||||
};
|
||||
if (states.contains(WidgetState.disabled)) {
|
||||
return decoration.copyWith(color: palette.surfaceSoft);
|
||||
}
|
||||
if (theme.brightness == Brightness.light) {
|
||||
final background = Color.alphaBlend(palette.textPrimary.withValues(alpha: 0.08), palette.surfaceSoft);
|
||||
final hoverBackground = Color.alphaBlend(
|
||||
palette.textPrimary.withValues(alpha: 0.13),
|
||||
palette.surfaceSoft,
|
||||
);
|
||||
return decoration.copyWith(color: states.contains(WidgetState.hovered) ? hoverBackground : background);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
textStyle: (context, states, value) => states.contains(WidgetState.disabled)
|
||||
? value.copyWith(color: palette.textMuted.withValues(alpha: 0.62))
|
||||
: value,
|
||||
iconTheme: (context, states, value) => states.contains(WidgetState.disabled)
|
||||
? value.copyWith(color: palette.textMuted.withValues(alpha: 0.62))
|
||||
: value,
|
||||
),
|
||||
child: shad.ComponentTheme<shad.ToastTheme>(
|
||||
data: const shad.ToastTheme(toastConstraints: BoxConstraints(maxWidth: 420)),
|
||||
child: child,
|
||||
child: shad.ComponentTheme<shad.CheckboxTheme>(
|
||||
data: shad.CheckboxTheme(
|
||||
size: AppDesignTokens.checkboxSize,
|
||||
gap: AppDesignTokens.checkboxLabelGap,
|
||||
borderColor: theme.brightness == Brightness.dark ? palette.textMuted : palette.border,
|
||||
),
|
||||
child: shad.ComponentTheme<shad.ToastTheme>(
|
||||
data: const shad.ToastTheme(toastConstraints: BoxConstraints(maxWidth: 420)),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,6 +10,7 @@ class AppDesignTokens {
|
||||
static const double contentHeaderHeight = 48;
|
||||
static const double taskRowHeight = 72;
|
||||
static const double controlRadius = 4;
|
||||
static const double dialogActionMinWidth = 100;
|
||||
static const double checkboxSize = 18;
|
||||
static const double checkboxLabelGap = 10;
|
||||
static const double taskDetailsDrawerMinWidth = 440;
|
||||
@@ -21,6 +22,9 @@ class AppDesignTokens {
|
||||
static const double settingsFormControlWidth = 420;
|
||||
static const double settingsNumberControlWidth = 168;
|
||||
static const double settingsItemMinLabelWidth = 160;
|
||||
static const EdgeInsets textFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 11);
|
||||
static const EdgeInsets compactTextFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 6);
|
||||
static const EdgeInsets numberTextFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 10);
|
||||
|
||||
static const EdgeInsets pagePadding = EdgeInsets.symmetric(horizontal: 32);
|
||||
static const EdgeInsets sidebarPadding = EdgeInsets.symmetric(horizontal: 16);
|
||||
|
||||
Reference in new issue
Block a user