Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI for the transaction form page, allowing inversed/reversed transactions to track refunds and debts #186

Merged
merged 25 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift click to select a range
6406421
feat(ux/ui): Change the transaction form UX
enrique-lozano Jul 22, 2024
83ca3ce
refactor: Rename `TransactionType` enum
enrique-lozano Jul 22, 2024
148ab42
fix: Reduce currency font size also on negative amounts
enrique-lozano Jul 22, 2024
61b9e91
feat: Add tr. type to the transactions table in DB
enrique-lozano Jul 23, 2024
c10f523
fix: Adjust graphs to accept reversed transactions
enrique-lozano Jul 23, 2024
c246e89
fix: Regenerate database queries
enrique-lozano Jul 23, 2024
2d97d00
feat: Add indicator for reversed transactions
enrique-lozano Jul 23, 2024
d7dfb3f
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Jul 24, 2024
1d06fbc
fix: Sign when changing the transaction type
enrique-lozano Jul 24, 2024
4cfb56e
feat: Disable the status selector on future transactions
enrique-lozano Jul 24, 2024
6cd6ea7
fix: Transfer form validations
enrique-lozano Jul 24, 2024
d17b3a4
feat: Hide negative toggle button on transfers
enrique-lozano Jul 24, 2024
9f1ccdf
feat(literals): Change note textarea placeholder
enrique-lozano Jul 24, 2024
4d33135
fix: Use account currency
enrique-lozano Jul 24, 2024
a0b9afc
fix: Prevent transaction form to resize on keyboard
enrique-lozano Jul 24, 2024
4af5c46
fix: Status selector scrolling issues
enrique-lozano Jul 24, 2024
a610d8e
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Jul 25, 2024
0a9bf03
fix(ux/ui): Description textarea color
enrique-lozano Jul 25, 2024
6134d1c
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Aug 1, 2024
8120682
fix: Category picker only displaying multi-type items
enrique-lozano Aug 1, 2024
db12db6
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Aug 2, 2024
1396732
feat: Improve tag selection in the transaction form
enrique-lozano Aug 2, 2024
9f91ef1
feat: Reversed transaction descriptions and indicators
enrique-lozano Aug 2, 2024
05f4d8e
feat: Improve brand blue color on dark mode
enrique-lozano Aug 3, 2024
6b09675
feat: Value in destiny modal
enrique-lozano Aug 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' into feat/allow-positive-expenses
  • Loading branch information
enrique-lozano committed Aug 1, 2024
commit 6134d1cc9e9eeb9c6e35bca007233c953abc9c54
11 changes: 5 additions & 6 deletions lib/app/home/dashboard.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 586,11 @@ class _HorizontalScrollableAccountList extends StatelessWidget {
initialData: 0.0,
stream: AccountService.instance
.getAccountsMoneyVariation(
accounts: [account],
startDate:
dateRangeService.startDate,
endDate: dateRangeService.endDate,
convertToPreferredCurrency:
false),
accounts: [account],
startDate: dateRangeService.startDate,
endDate: dateRangeService.endDate,
convertToPreferredCurrency: false,
),
builder: (context, snapshot) {
return TrendingValue(
percentage: snapshot.data!,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:flutter/material.dart';
import 'package:monekin/app/tags/tag_list.page.dart';
import 'package:monekin/app/tags/tags_selector.modal.dart';
import 'package:monekin/core/extensions/color.extensions.dart';
import 'package:monekin/core/models/tags/tag.dart';
import 'package:monekin/core/presentation/app_colors.dart';
Expand Down Expand Up @@ -141,13 141,17 @@ class _TransactionMoreInfoModalState extends State<_TransactionMoreInfoModal> {
label: Text(t.tags.add),
avatar: const Icon(Icons.add),
onPressed: () => showTagListModal(context,
selectedTags: moreInfoData.tags)
.then(
modal: TagSelector(
allowEmptySubmit: true,
includeNullTag: false,
selectedTags: moreInfoData.tags,
)).then(
(value) {
if (value != null) {
setState(() {
moreInfoData = moreInfoData.copyWith(
tags: value);
tags: value.nonNulls.toList(),
);
});
}
},
Expand Down
18 changes: 7 additions & 11 deletions lib/app/transactions/form/transaction_form.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 2,7 @@ import 'package:drift/drift.dart' as drift;
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:monekin/app/accounts/account_selector.dart';
import 'package:monekin/app/categories/categories_list.dart';
import 'package:monekin/app/categories/selectors/category_picker.dart';
import 'package:monekin/app/transactions/form/dialogs/transaction_more_info.modal.dart';
import 'package:monekin/app/transactions/form/dialogs/transaction_status_selector.dart';
import 'package:monekin/app/transactions/form/dialogs/transaction_title_modal.dart';
Expand All @@ -29,6 29,8 @@ import 'package:monekin/i18n/translations.g.dart';

import 'widgets/account_or_category_selector.dart';

enum TransactionFormMode { transfer, incomeOrExpense }

class TransactionFormPage extends StatefulWidget {
const TransactionFormPage(
{super.key,
Expand Down Expand Up @@ -365,20 367,14 @@ class _TransactionFormPageState extends State<TransactionFormPage> {
}

Future<void> selectCategory() async {
final modalRes = await showCategoryListModal(
final modalRes = await showCategoryPickerModal(
context,
CategoriesList(
mode: CategoriesListMode.modalSelectSubcategory,
selectedCategories: [
if (selectedCategory != null)
selectedCategory!.parentCategory ?? selectedCategory!
],
),
modal: CategoryPicker(selectedCategory: selectedCategory),
);

if (modalRes != null && modalRes.isNotEmpty) {
if (modalRes != null) {
setState(() {
selectedCategory = modalRes.first;
selectedCategory = modalRes;
});
}
}
Expand Down
6 changes: 6 additions & 0 deletions lib/core/extensions/lists.extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 38,9 @@ extension IntersectionExtension<T> on List<T> {
return intersectionWith(other);
}
}

extension PrintListItem on Iterable<String> {
String printFormatted() {
return join(', ');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -502,99 502,6 @@ class _FilterSheetModalState extends State<FilterSheetModal> {
});
},
),

/* ---------------------------------- */
/* -------------- TAGS -------------- */
/* ---------------------------------- */

const SizedBox(height: 16),
TagsFilterContainer(
child: StreamBuilder(
stream: TagService.instance.getTags(),
builder: (context, snapshot) {
return Wrap(
spacing: 6,
runSpacing: 0,
children: [
FilterChip(
label: Text(t.tags.without_tags),
selected: isTagSelected(null),
onSelected: (value) => setState(() {
var newListToAssign =
filtersToReturn.tagsIDs?.toList();

if (newListToAssign == null) {
newListToAssign =
snapshot.data!.map((e) => e.id).toList();
} else if (value) {
newListToAssign = [...newListToAssign, null];
} else {
newListToAssign.removeWhere(
(element) => element == null);
}

if (newListToAssign.length ==
snapshot.data!.length 1) {
newListToAssign = null;
}

setState(() {
filtersToReturn = filtersToReturn.copyWith(
tagsIDs: newListToAssign,
);
});
}),
showCheckmark: false,
avatar: Icon(Icons.label_off_rounded,
color: AppColors.of(context).primary),
),
if (snapshot.data != null)
...List.generate(snapshot.data!.length, (index) {
final tag = snapshot.data![index];

return FilterChip(
label: Text(tag.name),
selected: isTagSelected(tag.id),
onSelected: (value) {
var newListToAssign =
filtersToReturn.tagsIDs?.toList();

if (newListToAssign == null) {
newListToAssign = [
null,
...snapshot.data!
.whereNot((element) =>
element.id == tag.id)
.map((e) => e.id)
];
} else if (value) {
newListToAssign.add(tag.id);
} else {
newListToAssign.removeWhere(
(element) => element == tag.id);
}

if (newListToAssign.length ==
snapshot.data!.length 1) {
newListToAssign = null;
}

setState(() {
filtersToReturn =
filtersToReturn.copyWith(
tagsIDs: newListToAssign,
);
});
},
showCheckmark: false,
avatar: tag.displayIcon(),
);
}),
],
);
},
),
)
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/translations.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 6,7 @@
/// Locales: 4
/// Strings: 2117 (529 per locale)
///
/// Built on 2024-07-25 at 10:58 UTC
/// Built on 2024-08-01 at 22:10 UTC

// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down
44 changes: 22 additions & 22 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 205,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
url: "https://pub.dev"
source: hosted
version: "0.3.4 1"
version: "0.3.4 2"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -415,10 415,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: c6b0b4c05c458e1c01ad9bcc14041dd7b1f6783d487be4386f793f47a8a4d03e
sha256: "9d98bd47ef9d34e803d438f17fd32b116d31009f534a6fa5ce3a1167f189a6de"
url: "https://pub.dev"
source: hosted
version: "2.0.20"
version: "2.0.21"
flutter_svg:
dependency: "direct main"
description:
Expand Down Expand Up @@ -521,10 521,10 @@ packages:
dependency: transitive
description:
name: in_app_purchase_android
sha256: f3f3ded26d08d13383b8c9952d1cf1422f0a3440b04d27f9838adee86f2ce899
sha256: "4c3f46f736a31902ec5392a75f41ea1ad292f27db00ed51153f3912d076d0efa"
url: "https://pub.dev"
source: hosted
version: "0.3.6 2"
version: "0.3.6 5"
in_app_purchase_platform_interface:
dependency: transitive
description:
Expand All @@ -537,10 537,10 @@ packages:
dependency: transitive
description:
name: in_app_purchase_storekit
sha256: a4b523cdad26d9c81fe1f35636b9d46c459f6c07b84a93ae5cbdd93b21670eea
sha256: "28a0577d9f4a5bdfb7aad96c347193e1225cc335c8003fbb98b875a67dab34cc"
url: "https://pub.dev"
source: hosted
version: "0.3.17 2"
version: "0.3.17 3"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -721,18 721,18 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "30c5aa827a6ae95ce2853cdc5fe3971daaac00f6f081c419c013f7f57bff2f5e"
sha256: "490539678396d4c3c0b06efdaab75ae60675c3e0c66f72bc04c2e2c1e0e2abeb"
url: "https://pub.dev"
source: hosted
version: "2.2.7"
version: "2.2.9"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -793,10 793,10 @@ packages:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
sha256: "6cac773d389e045a8d4f85418d07ad58ef9e42a56e063629ce14c4c26344de24"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
version: "0.1.2"
permission_handler_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -974,10 974,10 @@ packages:
dependency: "direct main"
description:
name: sqlite3
sha256: "6d17989c0b06a5870b2190d391925186f944cb943e5262d0d3f778fcfca3bc6e"
sha256: fde692580bee3379374af1f624eb3e113ab2865ecb161dbe2d8ac2de9735dbdb
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "2.4.5"
sqlite3_flutter_libs:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1070,10 1070,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac"
sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9"
url: "https://pub.dev"
source: hosted
version: "6.3.5"
version: "6.3.8"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1110,10 1110,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a"
sha256: a36e2d7981122fa185006b216eb6b5b97ede3f9a54b7a511bc966971ab98d049
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -1206,10 1206,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9"
url: "https://pub.dev"
source: hosted
version: "5.5.1"
version: "5.5.3"
xdg_directories:
dependency: transitive
description:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.