This commit is contained in:
2026-03-21 01:40:44 +03:00
parent 331c99070a
commit a6e52ca089
+40 -27
View File
@@ -53,7 +53,6 @@ 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);
double _cardBottomY = 300;
HSVColor get _currentHSV => _editingPrimary ? _tempPrimaryHSV : _tempSecondaryHSV; HSVColor get _currentHSV => _editingPrimary ? _tempPrimaryHSV : _tempSecondaryHSV;
@@ -87,13 +86,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
_tempPrimaryHSV = HSVColor.fromColor(colors.primary); _tempPrimaryHSV = HSVColor.fromColor(colors.primary);
_tempSecondaryHSV = HSVColor.fromColor(colors.secondary); _tempSecondaryHSV = HSVColor.fromColor(colors.secondary);
// Calculate actual card bottom: status bar + appbar + top padding + card height
final statusBar = MediaQuery.of(context).padding.top;
final appBarHeight = kToolbarHeight;
final topPadding = 16.0;
final cardHeight = 180.0;
_cardBottomY = statusBar + appBarHeight + topPadding + cardHeight;
setState(() => _editingCard = true); setState(() => _editingCard = true);
} }
@@ -260,40 +252,62 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
} }
Widget _buildEditOverlay(BuildContext context) { Widget _buildEditOverlay(BuildContext context) {
final balance = ref.read(totalBalanceProvider);
final currencyInfo = ref.read(currencyProvider);
final cardTop = MediaQuery.of(context).padding.top + kToolbarHeight + 16;
final panelTop = cardTop + 180 + 16;
return Stack( return Stack(
children: [ children: [
// Calculate card position to EXCLUDE it from blur // FULL SCREEN BLUR — covers everything: appbar, card bg, footer
// Blur only the area BELOW the card
Positioned.fill( Positioned.fill(
child: Column(
children: [
// Top portion — card area — NOT blurred, transparent
SizedBox(height: _cardBottomY),
// Bottom portion — blurred
Expanded(
child: GestureDetector(
onTap: () => setState(() => _editingCard = false),
child: ClipRect(
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 18, sigmaY: 18), filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: Container( child: Container(
color: Colors.black.withOpacity(0.55), color: Colors.black.withOpacity(0.6),
), ),
), ),
), ),
// CARD HOLE — re-render card on top of blur so it appears unblurred
// Position it exactly where the real card is
Positioned(
top: cardTop,
left: 20,
right: 20,
child: IgnorePointer(
ignoring: false,
child: _BalanceCard(
balance: balance,
currencyInfo: currencyInfo,
onLongPress: null, // no re-trigger during edit
previewPrimary: _tempPrimary,
previewSecondary: _tempSecondary,
), ),
), ),
], ),
// DISMISS tap — only on the blurred area outside panel and card
Positioned.fill(
child: GestureDetector(
onTap: () {
setState(() {
_tempPrimary = _savedPrimary;
_tempSecondary = _savedSecondary;
_editingCard = false;
});
},
behavior: HitTestBehavior.translucent,
child: const SizedBox.expand(),
), ),
), ),
// Color editor panel — positioned below the card // COLOR EDITOR PANEL — above blur, below card
Positioned( Positioned(
left: 20, left: 20,
right: 20, right: 20,
top: _cardBottomY + 16, top: panelTop,
bottom: MediaQuery.of(context).padding.bottom + 16, bottom: MediaQuery.of(context).padding.bottom + 16,
child: GestureDetector( child: GestureDetector(
onTap: () {}, // prevent dismiss onTap: () {}, // prevent dismiss
behavior: HitTestBehavior.opaque,
child: _buildColorPanel(context), child: _buildColorPanel(context),
), ),
), ),
@@ -302,12 +316,11 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
} }
Widget _buildColorPanel(BuildContext context) { Widget _buildColorPanel(BuildContext context) {
final maxHeight = MediaQuery.of(context).size.height - _cardBottomY - 32 - MediaQuery.of(context).padding.bottom;
final isDark = Theme.of(context).brightness == Brightness.dark; final isDark = Theme.of(context).brightness == Brightness.dark;
return ConstrainedBox( return ConstrainedBox(
constraints: BoxConstraints( constraints: const BoxConstraints(
maxHeight: maxHeight, maxHeight: double.infinity,
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
physics: const ClampingScrollPhysics(), physics: const ClampingScrollPhysics(),