mirror of
https://github.com/koloideal/Casha.git
synced 2026-08-08 17:51:14 +03:00
step
This commit is contained in:
@@ -5,6 +5,7 @@ import '../../../../core/constants.dart';
|
||||
import '../../../../core/utils/card_layout.dart';
|
||||
import '../../../../shared/models/account.dart';
|
||||
import '../../../../shared/models/transaction.dart';
|
||||
import '../../../../shared/feature_flags/feature_flags_provider.dart';
|
||||
import '../../../../shared/widgets/byn_sign.dart';
|
||||
import '../../../settings/provider.dart';
|
||||
import '../../provider.dart';
|
||||
@@ -93,9 +94,10 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
|
||||
builder: (context, ref, _) {
|
||||
final exchangeService = ref.watch(exchangeRateServiceProvider);
|
||||
final cardHeight = ref.watch(cardHeightProvider);
|
||||
final isPremium = ref.watch(featureFlagsProvider).canEditCardColors;
|
||||
final editorPanelTop = cardTop + cardHeight + layout.sectionGap;
|
||||
final colorPanelTop = editorPanelTop + editorPanelHeight + layout.sectionGap;
|
||||
final colorPanelHeight = layout.colorPanelHeight(mq, colorPanelTop);
|
||||
final colorPanelHeight = isPremium ? layout.colorPanelHeight(mq, colorPanelTop) : 0.0;
|
||||
|
||||
double previewBalance = 0.0;
|
||||
if (!dash.isAddingAccount) {
|
||||
@@ -249,36 +251,38 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: colorPanelTop,
|
||||
left: 20,
|
||||
right: 20,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (_showCurrencyDropdown) {
|
||||
setState(() {
|
||||
_showCurrencyDropdown = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AccountColorPanel(
|
||||
dashboardState: dash,
|
||||
dashboardContext: widget.context,
|
||||
panelHeight: colorPanelHeight,
|
||||
layout: layout,
|
||||
isDuplicateName: _isDuplicateName,
|
||||
onDuplicateError: () {
|
||||
setState(() => _showDuplicateError = true);
|
||||
Future.delayed(const Duration(seconds: 3), () {
|
||||
if (mounted) {
|
||||
setState(() => _showDuplicateError = false);
|
||||
}
|
||||
});
|
||||
if (isPremium) ...[
|
||||
Positioned(
|
||||
top: colorPanelTop,
|
||||
left: 20,
|
||||
right: 20,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (_showCurrencyDropdown) {
|
||||
setState(() {
|
||||
_showCurrencyDropdown = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AccountColorPanel(
|
||||
dashboardState: dash,
|
||||
dashboardContext: widget.context,
|
||||
panelHeight: colorPanelHeight,
|
||||
layout: layout,
|
||||
isDuplicateName: _isDuplicateName,
|
||||
onDuplicateError: () {
|
||||
setState(() => _showDuplicateError = true);
|
||||
Future.delayed(const Duration(seconds: 3), () {
|
||||
if (mounted) {
|
||||
setState(() => _showDuplicateError = false);
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (_showCurrencyDropdown)
|
||||
Positioned(
|
||||
top: editorPanelTop + 62,
|
||||
|
||||
@@ -9,6 +9,7 @@ import '../../../core/utils/card_layout.dart';
|
||||
import '../../../shared/utils/card_gradient.dart';
|
||||
import '../../../core/services/haptic_service.dart';
|
||||
import '../../../shared/providers/amount_format_provider.dart';
|
||||
import '../../../shared/feature_flags/feature_flags_provider.dart';
|
||||
import '../../../shared/widgets/byn_sign.dart';
|
||||
import '../../settings/provider.dart';
|
||||
import '../provider.dart';
|
||||
@@ -110,6 +111,7 @@ class BalanceCardState extends ConsumerState<BalanceCard>
|
||||
.toList();
|
||||
|
||||
final textColorMode = ref.watch(cardTextColorProvider);
|
||||
final canEditCardColors = ref.watch(featureFlagsProvider).canEditCardColors;
|
||||
final Color onCard = switch (textColorMode) {
|
||||
CardTextColorMode.white => Colors.white,
|
||||
CardTextColorMode.black => Colors.black,
|
||||
@@ -324,12 +326,13 @@ class BalanceCardState extends ConsumerState<BalanceCard>
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 8,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Text(
|
||||
s.tapAndHoldToEdit,
|
||||
if (canEditCardColors)
|
||||
Positioned(
|
||||
bottom: 8,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Text(
|
||||
s.tapAndHoldToEdit,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
|
||||
@@ -5,6 +5,7 @@ import '../../../core/utils/card_layout.dart';
|
||||
import '../../../core/services/haptic_service.dart';
|
||||
import '../../../shared/models/account.dart';
|
||||
import '../../../shared/models/transaction.dart';
|
||||
import '../../../shared/feature_flags/feature_flags_provider.dart';
|
||||
import '../../settings/provider.dart';
|
||||
import '../provider.dart';
|
||||
import 'balance_card.dart';
|
||||
@@ -60,10 +61,11 @@ class _BalanceCardCarouselState extends ConsumerState<BalanceCardCarousel> {
|
||||
final accountsAsync = ref.watch(accountsProvider);
|
||||
final activeIndex = ref.watch(activeAccountIndexProvider);
|
||||
final cardHeight = ref.watch(cardHeightProvider);
|
||||
final maxAccounts = ref.watch(featureFlagsProvider).maxAccounts;
|
||||
|
||||
return accountsAsync.when(
|
||||
data: (accounts) {
|
||||
final totalPages = 1 + accounts.length + (accounts.length < 5 ? 1 : 0);
|
||||
final totalPages = 1 + accounts.length + (accounts.length < maxAccounts ? 1 : 0);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
@@ -7,6 +7,7 @@ import '../../../core/l10n/locale_provider.dart';
|
||||
import '../../../core/services/card_color_service.dart';
|
||||
import '../../../core/services/haptic_service.dart';
|
||||
import '../../../core/utils/card_layout.dart';
|
||||
import '../../../shared/feature_flags/feature_flags_provider.dart';
|
||||
import '../../settings/provider.dart';
|
||||
import '../provider.dart';
|
||||
import 'balance_card.dart';
|
||||
@@ -42,6 +43,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
return Consumer(
|
||||
builder: (context, ref, _) {
|
||||
final cardHeight = ref.watch(cardHeightProvider);
|
||||
final isPremium = ref.watch(featureFlagsProvider).canEditCardHeight;
|
||||
final heightDelta = (kBalanceCardHeight - cardHeight) / 2;
|
||||
final adjustedCardTop = cardTop + heightDelta;
|
||||
final panelTop = adjustedCardTop + cardHeight + layout.cardPreviewGap;
|
||||
@@ -90,7 +92,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
? dash.tempDarkGradientType
|
||||
: dash.tempLightGradientType,
|
||||
cardHeight: cardHeight,
|
||||
resizeHandle: _CornerResizeHandle(
|
||||
resizeHandle: isPremium ? _CornerResizeHandle(
|
||||
cardHeight: cardHeight,
|
||||
onHeightChanged: (newHeight) {
|
||||
ref.read(cardHeightProvider.notifier).set(newHeight);
|
||||
@@ -98,7 +100,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
|
||||
HapticService.selection();
|
||||
}
|
||||
},
|
||||
),
|
||||
) : null,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user