This commit is contained in:
2026-03-26 00:57:25 +03:00
parent 71de991587
commit 8ba9ae0b9f
9 changed files with 64 additions and 54 deletions
+2 -2
View File
@@ -199,7 +199,6 @@ class ExportService {
Future<String> exportToCSV() async {
final transactionsAsync = _ref.read(transactionsProvider);
final transactions = transactionsAsync.valueOrNull ?? [];
final currency = _ref.read(currencyProvider);
final fmt = _ref.read(amountFormatProvider);
final buffer = StringBuffer();
@@ -209,7 +208,8 @@ class ExportService {
final date = DateFormat('yyyy-MM-dd').format(tx.date);
final type = tx.type.name;
final category = tx.category;
final amount = formatAmount(tx.currency, tx.amount, fmt);
final sym = currencyMap[tx.currencyCode]?.symbol ?? '';
final amount = formatAmount(sym, tx.amount, fmt);
final note = tx.note?.replaceAll(',', ';') ?? '';
buffer.writeln('$date,$type,$category,$amount,${tx.currencyCode},$note');
}
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/constants.dart';
import '../../../core/l10n/locale_provider.dart';
import '../../../shared/providers/amount_format_provider.dart';
import '../../../shared/widgets/byn_sign.dart';
import '../provider.dart';
class AmountFormatSection extends ConsumerWidget {
@@ -94,20 +95,45 @@ class AmountFormatSection extends ConsumerWidget {
: FontWeight.w500,
),
),
Text(
format.example.replaceFirst(
'SYM',
currencyInfo.symbol.isEmpty
? 'Br'
: currencyInfo.symbol,
),
style: TextStyle(
color: Theme.of(
context,
).colorScheme.onSurface.withOpacity(0.6),
fontSize: 12,
),
),
currencyInfo.code == 'BYN'
? Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
BynSign(
fontSize: 12,
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6),
),
Text(
format.example.replaceFirst(
RegExp(r'SYM\s*'),
'',
),
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6),
fontSize: 12,
),
),
],
)
: Text(
format.example.replaceFirst(
'SYM',
currencyInfo.symbol,
),
style: TextStyle(
color: Theme.of(
context,
).colorScheme.onSurface.withOpacity(0.6),
fontSize: 12,
),
),
],
),
),