mirror of
https://github.com/koloideal/Casha.git
synced 2026-08-08 09:41:13 +03:00
step
This commit is contained in:
+17
-17
@@ -44,8 +44,8 @@ class AppTheme {
|
||||
scaffoldBackgroundColor: AppColors.background,
|
||||
colorScheme: const ColorScheme.dark(
|
||||
surface: AppColors.surface,
|
||||
primary: AppColors.accent,
|
||||
secondary: AppColors.accent,
|
||||
primary: const Color(0xFF7C6DED),
|
||||
secondary: const Color(0xFF7C6DED),
|
||||
onPrimary: Colors.white,
|
||||
onSurface: AppColors.textPrimary,
|
||||
),
|
||||
@@ -70,11 +70,11 @@ class AppTheme {
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
backgroundColor: AppColors.surface,
|
||||
indicatorColor: AppColors.accent.withOpacity(0.2),
|
||||
indicatorColor: const Color(0xFF7C6DED).withOpacity(0.2),
|
||||
labelTextStyle: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return GoogleFonts.poppins(
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
);
|
||||
@@ -86,7 +86,7 @@ class AppTheme {
|
||||
}),
|
||||
iconTheme: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return const IconThemeData(color: AppColors.accent);
|
||||
return const IconThemeData(color: const Color(0xFF7C6DED));
|
||||
}
|
||||
return const IconThemeData(color: AppColors.textSecondary);
|
||||
}),
|
||||
@@ -104,14 +104,14 @@ class AppTheme {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(color: AppColors.accent, width: 1.5),
|
||||
borderSide: const BorderSide(color: const Color(0xFF7C6DED), width: 1.5),
|
||||
),
|
||||
labelStyle: const TextStyle(color: AppColors.textSecondary),
|
||||
hintStyle: const TextStyle(color: AppColors.textSecondary),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.accent,
|
||||
backgroundColor: const Color(0xFF7C6DED),
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 52),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -145,8 +145,8 @@ class AppTheme {
|
||||
scaffoldBackgroundColor: const Color(0xFFF0F0F7),
|
||||
colorScheme: const ColorScheme.light(
|
||||
surface: Colors.white,
|
||||
primary: AppColors.accent,
|
||||
secondary: AppColors.accent,
|
||||
primary: const Color(0xFF7C6DED),
|
||||
secondary: const Color(0xFF7C6DED),
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Color(0xFF1A1A2E),
|
||||
),
|
||||
@@ -168,15 +168,15 @@ class AppTheme {
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
iconTheme: const IconThemeData(color: AppColors.accent),
|
||||
iconTheme: const IconThemeData(color: const Color(0xFF7C6DED)),
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
backgroundColor: Colors.white,
|
||||
indicatorColor: AppColors.accent.withOpacity(0.2),
|
||||
indicatorColor: const Color(0xFF7C6DED).withOpacity(0.2),
|
||||
labelTextStyle: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return GoogleFonts.poppins(
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
);
|
||||
@@ -188,7 +188,7 @@ class AppTheme {
|
||||
}),
|
||||
iconTheme: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return const IconThemeData(color: AppColors.accent);
|
||||
return const IconThemeData(color: const Color(0xFF7C6DED));
|
||||
}
|
||||
return const IconThemeData(color: Color(0xFF9999BB));
|
||||
}),
|
||||
@@ -206,14 +206,14 @@ class AppTheme {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: const BorderSide(color: AppColors.accent, width: 1.5),
|
||||
borderSide: const BorderSide(color: const Color(0xFF7C6DED), width: 1.5),
|
||||
),
|
||||
labelStyle: const TextStyle(color: Color(0xFF9999BB)),
|
||||
hintStyle: const TextStyle(color: Color(0xFF9999BB)),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.accent,
|
||||
backgroundColor: const Color(0xFF7C6DED),
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 52),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -229,10 +229,10 @@ class AppTheme {
|
||||
color: Color(0xFFDDDDEE),
|
||||
thickness: 1,
|
||||
),
|
||||
iconTheme: const IconThemeData(color: AppColors.accent),
|
||||
iconTheme: const IconThemeData(color: const Color(0xFF7C6DED)),
|
||||
chipTheme: ChipThemeData(
|
||||
backgroundColor: const Color(0xFFEEEEF8),
|
||||
selectedColor: AppColors.accent,
|
||||
selectedColor: const Color(0xFF7C6DED),
|
||||
labelStyle: GoogleFonts.poppins(
|
||||
color: const Color(0xFF1A1A2E),
|
||||
),
|
||||
|
||||
@@ -10,14 +10,14 @@ class CardColorService {
|
||||
static const _keyGradientLight = 'gradient_type_light';
|
||||
static const _keyGradientDark = 'gradient_type_dark';
|
||||
|
||||
static const defaultPrimary = Color(0xFFBEF264);
|
||||
static const defaultSecondary = Color(0xFF4D7C0F);
|
||||
static const defaultPrimary = Color(0xFF4CAF8C);
|
||||
static const defaultSecondary = Color(0xFF4CAF8C);
|
||||
|
||||
static const defaultPrimaryLight = Color(0xFF6A6482);
|
||||
static const defaultSecondaryLight = Color(0xFF000000);
|
||||
static const defaultPrimaryLight = Color(0xFF4CAF8C);
|
||||
static const defaultSecondaryLight = Color(0xFF4CAF8C);
|
||||
|
||||
static const defaultGradientLight = GradientType.sweep;
|
||||
static const defaultGradientDark = GradientType.radial;
|
||||
static const defaultGradientLight = GradientType.solid;
|
||||
static const defaultGradientDark = GradientType.solid;
|
||||
|
||||
static Future<(Color, Color, GradientType, GradientType)> load({
|
||||
int? accountId,
|
||||
|
||||
@@ -391,7 +391,7 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
|
||||
data: Theme.of(context).copyWith(
|
||||
colorScheme: Theme.of(
|
||||
context,
|
||||
).colorScheme.copyWith(primary: AppColors.accent),
|
||||
).colorScheme.copyWith(primary: const Color(0xFF7C6DED)),
|
||||
),
|
||||
child: child!,
|
||||
),
|
||||
@@ -995,7 +995,7 @@ class _ToAccountDropdownOverlay extends ConsumerWidget {
|
||||
const Icon(
|
||||
Icons.check_rounded,
|
||||
size: 16,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -73,7 +73,7 @@ class AccountSelector extends ConsumerWidget {
|
||||
const Icon(
|
||||
Icons.account_balance_wallet_rounded,
|
||||
size: 18,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Flexible(
|
||||
@@ -244,7 +244,7 @@ class AccountDropdownOverlay extends ConsumerWidget {
|
||||
const Icon(
|
||||
Icons.check_rounded,
|
||||
size: 16,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -105,22 +105,22 @@ class _AddCategoryChip extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.12),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.12),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.accent.withOpacity(0.5),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.5),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.add_rounded, color: AppColors.accent, size: 16),
|
||||
const Icon(Icons.add_rounded, color: const Color(0xFF7C6DED), size: 16),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
label,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -43,7 +43,7 @@ class NoteField extends StatelessWidget {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(color: Color(0xFF7C6DED), width: 1.5),
|
||||
borderSide: BorderSide(color: const Color(0xFF7C6DED), width: 1.5),
|
||||
),
|
||||
),
|
||||
onChanged: onChanged,
|
||||
|
||||
@@ -456,7 +456,7 @@ class _CategoryItem extends ConsumerWidget {
|
||||
final isRu = s.locale == AppLocale.ru;
|
||||
final catalog = ref.watch(categoryCatalogProvider);
|
||||
final fmt = ref.watch(amountFormatProvider);
|
||||
final color = catalog.colorFor(category, AppColors.accent);
|
||||
final color = catalog.colorFor(category, const Color(0xFF7C6DED));
|
||||
final icon = catalog.iconFor(category);
|
||||
final pct = total > 0 ? amount / total : 0.0;
|
||||
|
||||
@@ -571,7 +571,7 @@ class _SummaryBadgeRow extends ConsumerWidget {
|
||||
'${(share * 100).toStringAsFixed(1)}%',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -874,7 +874,7 @@ class _TimePeriodToggle extends ConsumerWidget {
|
||||
child: _ToggleChip(
|
||||
label: s.filterMonth,
|
||||
isSelected: filter == StatsTimeFilter.month,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
onTap: () => onChanged(StatsTimeFilter.month),
|
||||
),
|
||||
),
|
||||
@@ -882,7 +882,7 @@ class _TimePeriodToggle extends ConsumerWidget {
|
||||
child: _ToggleChip(
|
||||
label: s.filterAllTime,
|
||||
isSelected: filter == StatsTimeFilter.allTime,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
onTap: () => onChanged(StatsTimeFilter.allTime),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -90,11 +90,11 @@ class _ScopeChip extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.accent.withOpacity(0.2)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.2)
|
||||
: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: isSelected
|
||||
? Border.all(color: AppColors.accent, width: 1.5)
|
||||
? Border.all(color: const Color(0xFF7C6DED), width: 1.5)
|
||||
: isDark
|
||||
? null
|
||||
: Border.all(color: const Color(0xFFDDDDEE), width: 1),
|
||||
@@ -105,7 +105,7 @@ class _ScopeChip extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -487,7 +487,7 @@ class _AccountsInfoBlock extends ConsumerWidget {
|
||||
const Icon(
|
||||
Icons.account_balance_wallet_rounded,
|
||||
size: 18,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
|
||||
@@ -467,7 +467,7 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
|
||||
const Icon(
|
||||
Icons.check_rounded,
|
||||
size: 14,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -94,7 +94,7 @@ class _FilterChip extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final chipColor = color ?? AppColors.accent;
|
||||
final chipColor = color ?? const Color(0xFF7C6DED);
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
return GestureDetector(
|
||||
|
||||
@@ -52,7 +52,7 @@ class SearchBar extends StatelessWidget {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(color: Color(0xFF7C6DED), width: 1.5),
|
||||
borderSide: BorderSide(color: const Color(0xFF7C6DED), width: 1.5),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
@@ -471,7 +471,7 @@ class _TransferChip extends StatelessWidget {
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -334,7 +334,7 @@ class _CategoryEditorSheetState extends ConsumerState<CategoryEditorSheet> {
|
||||
child: FilledButton(
|
||||
onPressed: _saving ? null : _save,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.accent,
|
||||
backgroundColor: const Color(0xFF7C6DED),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
@@ -576,7 +576,7 @@ class _TranslatableField extends StatelessWidget {
|
||||
child: TextButton(
|
||||
onPressed: onApply,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: AppColors.accent,
|
||||
foregroundColor: const Color(0xFF7C6DED),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
minimumSize: const Size(0, 36),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
@@ -592,7 +592,7 @@ class _TranslatableField extends StatelessWidget {
|
||||
return IconButton(
|
||||
onPressed: onTranslate,
|
||||
icon: const Icon(Icons.translate_rounded, size: 20),
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
tooltip: '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class CategoryManagerScreen extends ConsumerWidget {
|
||||
HapticService.medium();
|
||||
showCategoryEditor(context);
|
||||
},
|
||||
backgroundColor: AppColors.accent,
|
||||
backgroundColor: const Color(0xFF7C6DED),
|
||||
foregroundColor: Colors.white,
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(
|
||||
|
||||
@@ -283,12 +283,12 @@ class _BiometricSectionState extends ConsumerState<_BiometricSection> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.fingerprint,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -33,12 +33,12 @@ class AmountFormatSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.format_list_numbered_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -69,11 +69,11 @@ class AmountFormatSection extends ConsumerWidget {
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.accent.withOpacity(0.2)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.2)
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: isSelected
|
||||
? Border.all(color: AppColors.accent, width: 1.5)
|
||||
? Border.all(color: const Color(0xFF7C6DED), width: 1.5)
|
||||
: (isDark
|
||||
? null
|
||||
: Border.all(
|
||||
@@ -88,7 +88,7 @@ class AmountFormatSection extends ConsumerWidget {
|
||||
format.label,
|
||||
style: TextStyle(
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface,
|
||||
fontWeight: isSelected
|
||||
? FontWeight.w600
|
||||
|
||||
@@ -30,12 +30,12 @@ class CardTextColorSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.text_fields_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -116,14 +116,14 @@ class _CardTextColorOption extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.accent.withOpacity(0.15)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.15)
|
||||
: (isDark
|
||||
? Colors.white.withOpacity(0.05)
|
||||
: Colors.black.withOpacity(0.03)),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: (isDark
|
||||
? Colors.white.withOpacity(0.1)
|
||||
: Colors.black.withOpacity(0.08)),
|
||||
@@ -136,7 +136,7 @@ class _CardTextColorOption extends StatelessWidget {
|
||||
Icon(
|
||||
icon,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
|
||||
size: 22,
|
||||
),
|
||||
@@ -147,7 +147,7 @@ class _CardTextColorOption extends StatelessWidget {
|
||||
fontSize: 11,
|
||||
fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -33,12 +33,12 @@ class CategoriesSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.category_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -27,12 +27,12 @@ class CurrencyConversionsSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.currency_exchange_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -31,12 +31,12 @@ class CurrencySection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.attach_money_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -68,11 +68,11 @@ class CurrencySection extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.accent.withOpacity(0.2)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.2)
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: isSelected
|
||||
? Border.all(color: AppColors.accent, width: 1.5)
|
||||
? Border.all(color: const Color(0xFF7C6DED), width: 1.5)
|
||||
: (isDark
|
||||
? null
|
||||
: Border.all(
|
||||
@@ -90,7 +90,7 @@ class CurrencySection extends ConsumerWidget {
|
||||
child: BynSign(
|
||||
fontSize: 24,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface
|
||||
.withOpacity(0.6),
|
||||
),
|
||||
@@ -101,7 +101,7 @@ class CurrencySection extends ConsumerWidget {
|
||||
style: Theme.of(context).textTheme.titleLarge
|
||||
?.copyWith(
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
@@ -117,7 +117,7 @@ class CurrencySection extends ConsumerWidget {
|
||||
style: Theme.of(context).textTheme.bodySmall
|
||||
?.copyWith(
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface
|
||||
.withOpacity(0.6),
|
||||
fontWeight: isSelected
|
||||
|
||||
@@ -25,12 +25,12 @@ class HapticSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.vibration_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,12 +28,12 @@ class LanguageSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.language_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -59,11 +59,11 @@ class LanguageSection extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: currentLocale == AppLocale.en
|
||||
? AppColors.accent.withOpacity(0.2)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.2)
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: currentLocale == AppLocale.en
|
||||
? Border.all(color: AppColors.accent, width: 1.5)
|
||||
? Border.all(color: const Color(0xFF7C6DED), width: 1.5)
|
||||
: (isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1)),
|
||||
),
|
||||
child: Text(
|
||||
@@ -71,7 +71,7 @@ class LanguageSection extends ConsumerWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: currentLocale == AppLocale.en
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||
fontWeight: currentLocale == AppLocale.en ? FontWeight.w600 : FontWeight.normal,
|
||||
),
|
||||
@@ -87,11 +87,11 @@ class LanguageSection extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: currentLocale == AppLocale.ru
|
||||
? AppColors.accent.withOpacity(0.2)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.2)
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: currentLocale == AppLocale.ru
|
||||
? Border.all(color: AppColors.accent, width: 1.5)
|
||||
? Border.all(color: const Color(0xFF7C6DED), width: 1.5)
|
||||
: (isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1)),
|
||||
),
|
||||
child: Text(
|
||||
@@ -99,7 +99,7 @@ class LanguageSection extends ConsumerWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: currentLocale == AppLocale.ru
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||
fontWeight: currentLocale == AppLocale.ru ? FontWeight.w600 : FontWeight.normal,
|
||||
),
|
||||
|
||||
@@ -32,13 +32,13 @@ class PremiumSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: (user.isVip ? AppColors.accent : AppColors.warning)
|
||||
color: (user.isVip ? const Color(0xFF7C6DED) : AppColors.warning)
|
||||
.withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
user.isVip ? Icons.workspace_premium_rounded : Icons.lock_outline_rounded,
|
||||
color: user.isVip ? AppColors.accent : AppColors.warning,
|
||||
color: user.isVip ? const Color(0xFF7C6DED) : AppColors.warning,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,7 +28,7 @@ class ThemeSection extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accent.withOpacity(0.15),
|
||||
color: const Color(0xFF7C6DED).withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
@@ -37,7 +37,7 @@ class ThemeSection extends ConsumerWidget {
|
||||
: themeMode == ThemeMode.light
|
||||
? Icons.light_mode_rounded
|
||||
: Icons.brightness_auto_rounded,
|
||||
color: AppColors.accent,
|
||||
color: const Color(0xFF7C6DED),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -112,12 +112,12 @@ class _ThemeOption extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.accent.withOpacity(0.15)
|
||||
? const Color(0xFF7C6DED).withOpacity(0.15)
|
||||
: (isDark ? Colors.white.withOpacity(0.05) : Colors.black.withOpacity(0.03)),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: (isDark ? Colors.white.withOpacity(0.1) : Colors.black.withOpacity(0.08)),
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
@@ -128,7 +128,7 @@ class _ThemeOption extends StatelessWidget {
|
||||
Icon(
|
||||
icon,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
|
||||
size: 22,
|
||||
),
|
||||
@@ -139,7 +139,7 @@ class _ThemeOption extends StatelessWidget {
|
||||
fontSize: 11,
|
||||
fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
|
||||
color: isSelected
|
||||
? AppColors.accent
|
||||
? const Color(0xFF7C6DED)
|
||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
+4
-1
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -25,7 +26,9 @@ void main() async {
|
||||
|
||||
final database = AppDatabase();
|
||||
|
||||
final billing = PlayBillingService();
|
||||
final billing = kDebugMode
|
||||
? DebugBillingService(prefs)
|
||||
: PlayBillingService();
|
||||
final premiumManager = PremiumManager(prefs, billing);
|
||||
await premiumManager.autoRestore();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class PaywallScreen extends ConsumerWidget {
|
||||
child: const Icon(
|
||||
Icons.workspace_premium_rounded,
|
||||
size: 64,
|
||||
color: Color(0xFF7C6DED),
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../features/dashboard/provider.dart';
|
||||
import '../services/billing_service.dart';
|
||||
|
||||
final billingServiceProvider = Provider<BillingService>((ref) {
|
||||
if (kDebugMode) {
|
||||
final prefs = ref.watch(sharedPreferencesProvider);
|
||||
return DebugBillingService(prefs);
|
||||
}
|
||||
return PlayBillingService();
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ class CategoryCatalog {
|
||||
byKey(key)?.icon ?? Icons.category_rounded;
|
||||
|
||||
Color colorFor(String key, [Color? fallback]) =>
|
||||
byKey(key)?.color ?? fallback ?? AppColors.accent;
|
||||
byKey(key)?.color ?? fallback ?? const Color(0xFF7C6DED);
|
||||
|
||||
String labelFor(String key, bool isRu) {
|
||||
final cat = byKey(key);
|
||||
@@ -147,7 +147,7 @@ AppCategory _defaultCategory(String key, TransactionType type) {
|
||||
labelEn: key,
|
||||
labelRu: AppCategories.ruLabels[key] ?? key,
|
||||
icon: categoryIconByName(iconName),
|
||||
color: AppCategories.colors[key] ?? AppColors.accent,
|
||||
color: AppCategories.colors[key] ?? const Color(0xFF7C6DED),
|
||||
iconName: iconName,
|
||||
isCustom: false,
|
||||
);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../features/dashboard/provider.dart';
|
||||
import '../models/user_model.dart';
|
||||
import '../services/premium_manager.dart';
|
||||
import 'billing_provider.dart';
|
||||
import 'current_user_provider.dart';
|
||||
|
||||
final premiumManagerProvider = Provider<PremiumManager>((ref) {
|
||||
final prefs = ref.watch(sharedPreferencesProvider);
|
||||
@@ -10,8 +12,8 @@ final premiumManagerProvider = Provider<PremiumManager>((ref) {
|
||||
});
|
||||
|
||||
final isPremiumProvider = Provider<bool>((ref) {
|
||||
final manager = ref.watch(premiumManagerProvider);
|
||||
return manager.isPremium;
|
||||
final user = ref.watch(currentUserProvider);
|
||||
return user.plan == UserPlan.vip;
|
||||
});
|
||||
|
||||
final purchaseTokenProvider = Provider<String?>((ref) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:in_app_purchase/in_app_purchase.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class PurchaseResult {
|
||||
final bool success;
|
||||
@@ -190,3 +191,49 @@ class PlayBillingService implements BillingService {
|
||||
await _controller.close();
|
||||
}
|
||||
}
|
||||
|
||||
class DebugBillingService implements BillingService {
|
||||
static const _key = 'debug_purchase_token';
|
||||
final SharedPreferences _prefs;
|
||||
final _controller = StreamController<List<PurchaseDetails>>.broadcast();
|
||||
|
||||
DebugBillingService(this._prefs);
|
||||
|
||||
@override
|
||||
Stream<List<PurchaseDetails>> get purchaseStream => _controller.stream;
|
||||
|
||||
@override
|
||||
Future<PurchaseResult> purchasePro() async {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
final token = 'debug_token_${DateTime.now().millisecondsSinceEpoch}';
|
||||
await _prefs.setString(_key, token);
|
||||
return PurchaseResult.ok(token);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PurchaseResult> restorePurchases() async {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
final token = _prefs.getString(_key);
|
||||
if (token != null) {
|
||||
return PurchaseResult.ok(token);
|
||||
}
|
||||
return const PurchaseResult();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PurchaseResult> queryPastPurchase() async {
|
||||
final token = _prefs.getString(_key);
|
||||
if (token != null) {
|
||||
return PurchaseResult.ok(token);
|
||||
}
|
||||
return const PurchaseResult();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> completePurchase(String purchaseToken) async {}
|
||||
|
||||
@override
|
||||
Future<void> dispose() async {
|
||||
await _controller.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ class PremiumManager {
|
||||
}
|
||||
|
||||
Future<PurchaseResult> purchase() async {
|
||||
if (isPremium) {
|
||||
return PurchaseResult.ok(purchaseToken ?? 'existing');
|
||||
}
|
||||
final result = await _billing.purchasePro();
|
||||
if (result.success && result.purchaseToken != null) {
|
||||
await _setPremium(true, result.purchaseToken);
|
||||
|
||||
@@ -25,9 +25,9 @@ class _ProScreenState extends ConsumerState<ProScreen>
|
||||
late final Animation<double> _successScale;
|
||||
|
||||
static const _gradientColors = [
|
||||
Color(0xFF283593),
|
||||
Color(0xFF5E35B1),
|
||||
Color(0xFFD81B60),
|
||||
Color(0xFF1B5E20),
|
||||
Color(0xFF2E7D32),
|
||||
Color(0xFF4CAF8C),
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -132,7 +132,7 @@ class _ProScreenState extends ConsumerState<ProScreen>
|
||||
) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 20),
|
||||
padding: const EdgeInsets.symmetric(vertical: 36, horizontal: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
|
||||
@@ -10,9 +10,9 @@ class ProSubscriptionCard extends ConsumerWidget {
|
||||
const ProSubscriptionCard({super.key});
|
||||
|
||||
static const _gradientColors = [
|
||||
Color(0xFF283593),
|
||||
Color(0xFF5E35B1),
|
||||
Color(0xFFD81B60),
|
||||
Color(0xFF1B5E20),
|
||||
Color(0xFF2E7D32),
|
||||
Color(0xFF4CAF8C),
|
||||
];
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user