Skip to content

Commit

Permalink
Merge pull request #175 from flow-mn/sadespresso/feat-search-txns-160
Browse files Browse the repository at this point in the history
Beta v0.6.0
  • Loading branch information
sadespresso authored Aug 10, 2024
2 parents d13dc5c + 6ba5659 commit 933be27
Show file tree
Hide file tree
Showing 78 changed files with 2,958 additions and 703 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Beta 0.6.0

* Added exchange rates, currently only works in Stats tab
* Stats tab:
* Converts all money to the primary currency
* Now separates income/expense
* Fallback when there's no exchange rate
* Home tab
* Search, filter transactions
* Set planned transaction preferences @ preferences page
* Minor, QoL
* Added error builder for Image `FlowIcon`s when the image is missing
* TimeRange selector now listens for mouse wheel scroll
* Frecency data updates one per day max. (was updating at every launch before)
* Updated theme to correct `activeColor` for radio/checkboxes and its lists
* Flutter upgraded to 3.24.0
* Dart upgraded to 3.5

## Beta 0.5.5

* Selecting icons should be slightly better
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
unawaited_futures: true
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ configurations {
}

dependencies {
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.8.0")
debugImplementation("io.objectbox:objectbox-android-objectbrowser:4.0.1")
}
35 changes: 32 additions & 3 deletions assets/l10n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@
"transaction.new": "New transaction",
"transaction.edit": "Edit transaction",
"transaction.edit.selectAccount": "Select an account",
"transaction.edit.selectAccount.multiple": "Select accounts",
"transaction.edit.selectAccount.noPossibleChoice": "No accounts to select",
"transaction.edit.selectCategory": "Select a category",
"transaction.edit.selectCategory.multiple": "Select categories",
"transaction.date": "Transaction date",
"transaction.createdDate": "Created at",
"transaction.fallbackTitle": "Untitled transaction",
Expand All @@ -102,6 +104,20 @@
"transactions.upcoming": "Upcoming transactions",
"transactions.query.noResult": "No transactions to show",
"transactions.query.noResult.description": "Try updating the filters",
"transactions.query.clearAll": "Clear filters",
"transactions.query.clearSelection": "Clear selections",
"transactions.query.filter.keyword": "Search",
"transactions.query.filter.keyword.all": "Search",
"transactions.query.filter.keyword.hint": "Search by title...",
"transactions.query.filter.keyword.clear": "Clear",
"transactions.query.filter.timeRange": "Time Range",
"transactions.query.filter.timeRange.all": "All Time",
"transactions.query.filter.accounts": "Accounts",
"transactions.query.filter.accounts.n": "{} accounts",
"transactions.query.filter.accounts.all": "All Accounts",
"transactions.query.filter.categories": "Categories",
"transactions.query.filter.categories.n": "{} categories",
"transactions.query.filter.categories.all": "All Categories",
"transactions.count": "{} transactions",

"category": "Category",
Expand All @@ -120,8 +136,9 @@
"preferences": "Preferences",
"preferences.primaryCurrency": "Primary currency",
"preferences.language": "Language",
"preferences.language.choose": "Choose language",
"preferences.language.choose": "Select a language",
"preferences.themeMode": "Theme",
"preferences.themeMode.choose": "Select a theme",
"preferences.themeMode.light": "Light",
"preferences.themeMode.dark": "Dark",
"preferences.themeMode.system": "Auto (system)",
Expand All @@ -139,8 +156,16 @@
"preferences.transfer.combineTransferTransaction": "Layout",
"preferences.transfer.combineTransferTransaction.combine": "Combine",
"preferences.transfer.combineTransferTransaction.separate": "Separate",
"preferences.transfer.combineTransferTransaction.filterDescription": "When using filters, transfers will always display separately",
"preferences.transfer.excludeTransferFromFlow": "Exclude from totals",
"preferences.transfer.excludeTransferFromFlow.description": "Don't count towards total expense/income",
"preferences.home": "Home page",
"preferences.home.upcoming": "Upcoming transactions",
"preferences.home.upcoming.none": "None",
"preferences.home.upcoming.description": "Shows planned transactions for the selected duration",
"preferences.home.upcoming.nextNdays": "Next {} days",
"preferences.home.upcoming.alwaysVisible": "Always show",
"preferences.home.upcoming.alwaysVisible.description": "Stay visible when the filters are active",

"tabs.home": "Home",
"tabs.home.greetings": "Hi, {name}!",
Expand All @@ -158,15 +183,19 @@
"tabs.stats.timeRange.select": "Select range",
"tabs.stats.timeRange.changeMode": "More options",
"tabs.stats.timeRange.presets": "Common options",
"tabs.stats.timeRange.last30days": "Last 30 days",
"tabs.stats.timeRange.thisWeek": "This week",
"tabs.stats.timeRange.thisMonth": "This month",
"tabs.stats.timeRange.thisYear": "This year",
"tabs.stats.timeRange.mode.custom": "Custom range",
"tabs.stats.timeRange.mode.byWeek": "By week",
"tabs.stats.timeRange.mode.byMonth": "By month",
"tabs.stats.timeRange.mode.byYear": "By year",
"tabs.stats.chart.total": "Total",
"tabs.stats.chart.noData": "No data to show",
"tabs.stats.chart.select.clickToSelect": "Click to select",
"tabs.stats.chart.noExchangeRatesWarning": "Missing exchange rate data. Transactions in non-primary currencies are not displayed.",
"tabs.stats.chart.noExchangeRatesWarning.retry": "Retry",
"tabs.accounts": "Accounts",
"tabs.accounts.reorder": "Reorder accounts",
"tabs.accounts.reorder.guide": "Long press and drag",
Expand Down Expand Up @@ -196,8 +225,8 @@
"flowIcon.type.icon.symbols": "Symbols",
"flowIcon.type.icon.search": "Search icons...",
"flowIcon.type.image": "Image",
"flowIcon.type.image.pick": "Choose an image",
"flowIcon.type.image.description": "Choose an image to use as an icon",
"flowIcon.type.image.pick": "Pick an image",
"flowIcon.type.image.description": "Pick an image to use as an icon",
"flowIcon.type.character": "Character",
"flowIcon.type.character.description": "Enter an emoji or a letter to use as an icon",

Expand Down
32 changes: 31 additions & 1 deletion assets/l10n/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@
"transaction.new": "Nuova transazione",
"transaction.edit": "Modifica transazione",
"transaction.edit.selectAccount": "Seleziona un conto",
"transaction.edit.selectAccount.multiple": "Seleziona conti",
"transaction.edit.selectAccount.noPossibleChoice": "Nessun conto da selezionare",
"transaction.edit.selectCategory": "Seleziona una categoria",
"transaction.edit.selectCategory.multiple": "Seleziona categorie",
"transaction.date": "Data della transazione",
"transaction.createdDate": "Creata il",
"transaction.fallbackTitle": "Transazione senza titolo",
Expand All @@ -102,6 +104,20 @@
"transactions.upcoming": "Prossime transazioni",
"transactions.query.noResult": "Nessuna transazione da mostrare",
"transactions.query.noResult.description": "Prova ad aggiornare i filtri",
"transactions.query.clearAll": "Cancella filtri",
"transactions.query.clearSelection": "Cancella selezioni",
"transactions.query.filter.keyword": "Cerca",
"transactions.query.filter.keyword.all": "Cerca",
"transactions.query.filter.keyword.hint": "Cerca per titolo...",
"transactions.query.filter.keyword.clear": "Cancella cerca",
"transactions.query.filter.timeRange": "Periodo",
"transactions.query.filter.timeRange.all": "Tutto il tempo",
"transactions.query.filter.accounts": "Conti",
"transactions.query.filter.accounts.n": "{} conti",
"transactions.query.filter.accounts.all": "Tutti i conti",
"transactions.query.filter.categories": "Categorie",
"transactions.query.filter.categories.n": "{} categorie",
"transactions.query.filter.categories.all": "Tutte le categorie",
"transactions.count": "{count} transazioni",

"category": "Categoria",
Expand All @@ -120,8 +136,9 @@
"preferences": "Preferenze",
"preferences.primaryCurrency": "Valuta principale",
"preferences.language": "Lingua",
"preferences.language.choose": "Scegli lingua",
"preferences.language.choose": "Selezionare una lingua",
"preferences.themeMode": "Tema",
"preferences.themeMode.choose": "Seleziona un tema",
"preferences.themeMode.light": "Chiaro",
"preferences.themeMode.dark": "Scuro",
"preferences.themeMode.system": "Auto (sistema)",
Expand All @@ -139,8 +156,16 @@
"preferences.transfer.combineTransferTransaction": "Layout",
"preferences.transfer.combineTransferTransaction.combine": "Combina",
"preferences.transfer.combineTransferTransaction.separate": "Separa",
"preferences.transfer.combineTransferTransaction.filterDescription": "Utilizzando i filtri, i trasferimenti verranno sempre visualizzati separatamente",
"preferences.transfer.excludeTransferFromFlow": "Escludi dai totali",
"preferences.transfer.excludeTransferFromFlow.description": "Non conteggiare verso la spesa/entrata totale",
"preferences.home": "Home page",
"preferences.home.upcoming": "Prossime transazioni",
"preferences.home.upcoming.description": "Mostra le transazioni pianificate per la durata selezionata",
"preferences.home.upcoming.none": "Nessuno",
"preferences.home.upcoming.nextNdays": "Prossimi {} giorni",
"preferences.home.upcoming.alwaysVisible": "Mostra sempre",
"preferences.home.upcoming.alwaysVisible.description": "Rimane visibile quando i filtri sono attivi",

"tabs.home": "Home",
"tabs.home.greetings": "Ciao, {name}!",
Expand All @@ -158,15 +183,19 @@
"tabs.stats.timeRange.select": "Seleziona intervallo",
"tabs.stats.timeRange.changeMode": "Più opzioni",
"tabs.stats.timeRange.presets": "Opzioni comuni",
"tabs.stats.timeRange.last30days": "Ultimi 30 giorni",
"tabs.stats.timeRange.thisWeek": "Questa settimana",
"tabs.stats.timeRange.thisMonth": "Questo mese",
"tabs.stats.timeRange.thisYear": "Quest'anno",
"tabs.stats.timeRange.mode.custom": "Intervallo personalizzato",
"tabs.stats.timeRange.mode.byWeek": "Per settimana",
"tabs.stats.timeRange.mode.byMonth": "Per mese",
"tabs.stats.timeRange.mode.byYear": "Per anno",
"tabs.stats.chart.total": "Totale",
"tabs.stats.chart.noData": "Nessun dato da mostrare",
"tabs.stats.chart.select.clickToSelect": "Clicca per selezionare",
"tabs.stats.chart.noExchangeRatesWarning": "Dati dei tassi di cambio mancanti. Le transazioni in valute diverse dalla principale non sono visualizzate.",
"tabs.stats.chart.noExchangeRatesWarning.retry": "Riprova",
"tabs.accounts": "Conti",
"tabs.accounts.reorder": "Riordina i conti",
"tabs.accounts.reorder.guide": "Premi a lungo e trascina",
Expand Down Expand Up @@ -229,6 +258,7 @@
"sync.export.onDeviceWarning": "Tutti i backup sono memorizzati sul dispositivo, il che significa che quando disinstalli Flow o reimposti il tuo dispositivo, tutti i backup saranno persi!",
"sync.export.history": "Cronologia backup",
"sync.export.history.empty": "Non ci sono backup",
"sync.export.history.empty.description": "Verranno elencati qui i backup effettuati manualmente e automaticamente",
"sync.export.history.description": "Vedi i backup fatti da te e creati automaticamente",
"sync.export.success": "Esportazione riuscita!",
"sync.export.success.filePath[0]": "Salvato in ",
Expand Down
31 changes: 30 additions & 1 deletion assets/l10n/mn_MN.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@
"transaction.new": "Гүйлгээ нэмэх",
"transaction.edit": "Гүйлгээ засварлах",
"transaction.edit.selectAccount": "Данс сонгох",
"transaction.edit.selectAccount.multiple": "Дансууд сонгох",
"transaction.edit.selectAccount.noPossibleChoice": "Сонгох боломжтой данс алга байна",
"transaction.edit.selectCategory": "Ангилал сонгох",
"transaction.edit.selectCategory.multiple": "Ангилаллууд сонгох",
"transaction.date": "Гүйлгээний огноо",
"transaction.createdDate": "Үүсгэсэн огноо",
"transaction.fallbackTitle": "Гарчиггүй гүйлгээ",
Expand All @@ -102,6 +104,20 @@
"transactions.upcoming": "Төлөвлөсөн гүйлгээнүүд",
"transactions.query.noResult": "Тохирох гүйлгээнүүд олдсонгүй",
"transactions.query.noResult.description": "Шүүлтүүрээ өөрчлөөд дахин оролдоно уу",
"transactions.query.clearAll": "Шүүлтүүрийг цэвэрлэх",
"transactions.query.clearSelection": "Сонголтуудыг цэвэрлэх",
"transactions.query.filter.keyword": "Хайх",
"transactions.query.filter.keyword.all": "Хайх",
"transactions.query.filter.keyword.hint": "Гарчгаар хайх...",
"transactions.query.filter.keyword.clear": "Цэвэрлэх",
"transactions.query.filter.timeRange": "Хугацаа",
"transactions.query.filter.timeRange.all": "Бүх цаг үе",
"transactions.query.filter.accounts": "Данс",
"transactions.query.filter.accounts.n": "{} данс",
"transactions.query.filter.accounts.all": "Бүх данс",
"transactions.query.filter.categories": "Ангилал",
"transactions.query.filter.categories.n": "{} ангилал",
"transactions.query.filter.categories.all": "Бүх ангилал",
"transactions.count": "{} гүйлгээ",

"category": "Ангилал",
Expand All @@ -122,6 +138,7 @@
"preferences.language": "Хэл",
"preferences.language.choose": "Хэл сонгох",
"preferences.themeMode": "Үзэмж",
"preferences.themeMode.choose": "Үзэмж сонгох",
"preferences.themeMode.light": "Гэгээлэг",
"preferences.themeMode.dark": "Харанхуй",
"preferences.themeMode.system": "Авто (систем)",
Expand All @@ -134,13 +151,21 @@
"preferences.transactionButtonOrder": "Товчны байрлал",
"preferences.transactionButtonOrder.description": "Шинэ гүйлгээ хийх товчны байрлал өөрчлөх",
"preferences.transactionButtonOrder.guide": "Чирж байрлалыг өөрчлөөрэй",
"preferences.transfer": "Шижлүүлэг",
"preferences.transfer": "Шилжүүлэг",
"preferences.transfer.description": "Нэгтгэж харах, орлого/зарлагаас хасах",
"preferences.transfer.combineTransferTransaction": "Харагдах байдал",
"preferences.transfer.combineTransferTransaction.combine": "Нэгтгэх",
"preferences.transfer.combineTransferTransaction.separate": "Салгах",
"preferences.transfer.combineTransferTransaction.filterDescription": "Шүүлтүүр ашиглаж байх үед үргэлж салангид харагдах болно",
"preferences.transfer.excludeTransferFromFlow": "Нийт дүнд оруулахгүй",
"preferences.transfer.excludeTransferFromFlow.description": "Идэвхтэй үед орлого/зарлага-д тоолохгүй",
"preferences.home": "Нүүр хуудас",
"preferences.home.upcoming": "Төлөвлөсөн гүйлгээнүүд",
"preferences.home.upcoming.description": "Сонгосон хугацааны төлөвлөгөөт гүйлгээнүүдийг харуулна",
"preferences.home.upcoming.none": "Харуулахгүй",
"preferences.home.upcoming.nextNdays": "Ирэх {} хоног",
"preferences.home.upcoming.alwaysVisible": "Үргэлж харуулах",
"preferences.home.upcoming.alwaysVisible.description": "Шүүлтүүр өөрчлөгдсөн ч харуулах",

"tabs.home": "Нүүр",
"tabs.home.greetings": "Сайн уу, {name}?",
Expand All @@ -158,15 +183,19 @@
"tabs.stats.timeRange.select": "Хугацаа сонгох",
"tabs.stats.timeRange.changeMode": "Өөр сонголтууд",
"tabs.stats.timeRange.presets": "Түгээмэл сонголтууд",
"tabs.stats.timeRange.last30days": "Сүүлийн 30 хоног",
"tabs.stats.timeRange.thisWeek": "Энэ долоо хоног",
"tabs.stats.timeRange.thisMonth": "Энэ сар",
"tabs.stats.timeRange.thisYear": "Энэ жил",
"tabs.stats.timeRange.mode.custom": "Эхлэх дуусах огноо",
"tabs.stats.timeRange.mode.byWeek": "Долоо хоногоор",
"tabs.stats.timeRange.mode.byMonth": "Сараар",
"tabs.stats.timeRange.mode.byYear": "Жилээр",
"tabs.stats.chart.total": "Нийт",
"tabs.stats.chart.noData": "Харуулах өгөгдөл байхгүй байна",
"tabs.stats.chart.select.clickToSelect": "Товшиж сонгоно уу",
"tabs.stats.chart.noExchangeRatesWarning": "Валютын ханшийн мэдээлэл байхгүй учир үндсэн валютаас ({currency}) бусад гүйлгээнүүд харагдахгүй байна",
"tabs.stats.chart.noExchangeRatesWarning.retry": "Дахин оролдох",
"tabs.accounts": "Данснууд",
"tabs.accounts.reorder": "Дараалал өөрчлөх",
"tabs.accounts.reorder.guide": "Удаан дарж чирнэ үү",
Expand Down
24 changes: 24 additions & 0 deletions lib/data/chart_data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:flow/data/money.dart';
import 'package:flow/services/exchange_rates.dart';

class ChartData<T> implements Comparable<ChartData<T>> {
final String key;
final Money money;
final T? associatedData;

double get displayTotal => money.amount.abs();

ChartData({
required this.key,
required this.money,
required this.associatedData,
});

@override
int compareTo(ChartData<T> other) {
return money.tryCompareToWithExchange(
other.money,
ExchangeRatesService().getPrimaryCurrencyRates(),
);
}
}
4 changes: 4 additions & 0 deletions lib/data/currencies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1399,3 +1399,7 @@ final Map<String, CurrencyData> iso4217CurrenciesGrouped =
);
},
);

bool isCurrencyCodeValid(String currencyCode) {
return iso4217CurrenciesGrouped.containsKey(currencyCode.toUpperCase());
}
35 changes: 35 additions & 0 deletions lib/data/exchange_rates.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:moment_dart/moment_dart.dart';

/// Uses endpoints from here:
class ExchangeRates {
final DateTime date;
final String baseCurrency;
final Map<String, num> rates;

const ExchangeRates({
required this.date,
required this.baseCurrency,
required this.rates,
});

factory ExchangeRates.fromJson(Map<String, dynamic> json) {
final String baseCurrency = json.keys.firstWhere((key) => key != "date");

return ExchangeRates(
date: DateTime.parse(json['date']),
baseCurrency: baseCurrency,
rates: Map<String, num>.from(json[baseCurrency.toLowerCase()]),
);
}

Map<String, dynamic> toJson() {
return {
"date": date.format(payload: "YYYY-MM-DD"),
baseCurrency: rates,
};
}

double? getRate(String currency) {
return rates[currency.toLowerCase()]?.toDouble();
}
}
Loading

0 comments on commit 933be27

Please sign in to comment.