mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
@@ -156,7 +156,7 @@ class CardColors {
|
||||
final Color secondary;
|
||||
final GradientType gradientType;
|
||||
|
||||
const CardColors(this.primary, this.secondary, [this.gradientType = GradientType.linear]);
|
||||
const CardColors(this.primary, this.secondary, this.gradientType);
|
||||
}
|
||||
|
||||
final cardColorsProvider = StateNotifierProvider<CardColorsNotifier, CardColors>((ref) {
|
||||
@@ -168,7 +168,7 @@ class CardColorsNotifier extends StateNotifier<CardColors> {
|
||||
: super(const CardColors(
|
||||
CardColorService.defaultPrimary,
|
||||
CardColorService.defaultSecondary,
|
||||
GradientType.linear,
|
||||
CardColorService.defaultGradient,
|
||||
)) {
|
||||
_load();
|
||||
}
|
||||
@@ -186,7 +186,7 @@ class CardColorsNotifier extends StateNotifier<CardColors> {
|
||||
Future<void> reset(bool isDark) async {
|
||||
final primary = isDark ? CardColorService.defaultPrimary : CardColorService.defaultPrimaryLight;
|
||||
final secondary = isDark ? CardColorService.defaultSecondary : CardColorService.defaultSecondaryLight;
|
||||
state = CardColors(primary, secondary, GradientType.linear);
|
||||
await CardColorService.save(primary, secondary, GradientType.linear);
|
||||
state = CardColors(primary, secondary, CardColorService.defaultGradient);
|
||||
await CardColorService.save(primary, secondary, CardColorService.defaultGradient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
Color savedSecondary = CardColorService.defaultSecondary;
|
||||
HSVColor savedPrimaryHSV = HSVColor.fromColor(CardColorService.defaultPrimary);
|
||||
HSVColor savedSecondaryHSV = HSVColor.fromColor(CardColorService.defaultSecondary);
|
||||
GradientType tempGradientType = GradientType.linear;
|
||||
GradientType savedGradientType = GradientType.linear;
|
||||
GradientType tempGradientType = CardColorService.defaultGradient;
|
||||
GradientType savedGradientType = CardColorService.defaultGradient;
|
||||
OverlayEntry? overlayEntry;
|
||||
|
||||
void _onCardLongPress() {
|
||||
|
||||
@@ -136,7 +136,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
isDimmed: isSolid,
|
||||
onTap: () {
|
||||
dash.setState(() {
|
||||
if (isSolid) dash.tempGradientType = GradientType.linear;
|
||||
if (isSolid) dash.tempGradientType = CardColorService.defaultGradient;
|
||||
dash.editingPrimary = true;
|
||||
});
|
||||
setPanelState(() {});
|
||||
@@ -153,7 +153,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
isDimmed: isSolid,
|
||||
onTap: () {
|
||||
dash.setState(() {
|
||||
if (isSolid) dash.tempGradientType = GradientType.linear;
|
||||
if (isSolid) dash.tempGradientType = CardColorService.defaultGradient;
|
||||
dash.editingPrimary = false;
|
||||
});
|
||||
setPanelState(() {});
|
||||
@@ -497,7 +497,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
dash.tempSecondary = defS;
|
||||
dash.tempPrimaryHSV = HSVColor.fromColor(defP);
|
||||
dash.tempSecondaryHSV = HSVColor.fromColor(defS);
|
||||
dash.tempGradientType = GradientType.linear;
|
||||
dash.tempGradientType = CardColorService.defaultGradient;
|
||||
});
|
||||
setPanelState(() {});
|
||||
dash.overlayEntry?.markNeedsBuild();
|
||||
@@ -569,11 +569,12 @@ class PanelTab extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final unselectedBorder =
|
||||
isDark ? Colors.white24 : const Color(0xFFCCCCDD);
|
||||
final unselectedText = isDark
|
||||
? Colors.white60
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
|
||||
final borderColor = isSelected
|
||||
? const Color(0xFF7C6DED)
|
||||
: (isDark ? Colors.white24 : const Color(0xFFCCCCDD));
|
||||
final textColor = isSelected
|
||||
? const Color(0xFF7C6DED)
|
||||
: (isDark ? Colors.white60 : Theme.of(context).colorScheme.onSurface.withOpacity(0.5));
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
@@ -585,10 +586,10 @@ class PanelTab extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? color.withOpacity(0.15) : Colors.transparent,
|
||||
color: isSelected ? const Color(0xFF7C6DED).withOpacity(0.15) : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: isSelected ? color : unselectedBorder,
|
||||
color: borderColor,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
@@ -619,7 +620,7 @@ class PanelTab extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
isSelected ? FontWeight.w600 : FontWeight.normal,
|
||||
color: isSelected ? color : unselectedText,
|
||||
color: textColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -96,7 +96,7 @@ class SettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
body: ListView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
padding: const EdgeInsets.fromLTRB(20, 16, 20, 100),
|
||||
padding: const EdgeInsets.fromLTRB(20, 16, 20, 40),
|
||||
children: [
|
||||
const ThemeSection(),
|
||||
const SizedBox(height: 16),
|
||||
@@ -141,10 +141,8 @@ class SettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
const SizedBox(height: 40),
|
||||
const _FooterWidget(),
|
||||
const SizedBox(height: 32),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user