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