Skip to content

Commit

Permalink
Enahcnements
Browse files Browse the repository at this point in the history
  • Loading branch information
sadespresso committed Dec 5, 2024
1 parent 57d499c commit f74f4f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
24 changes: 14 additions & 10 deletions lib/utils/extensions/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ import "package:flow/entity/transaction.dart";
import "package:moment_dart/moment_dart.dart";

extension TransactionHelpers on Transaction {
bool confirmable([DateTime? anchor]) =>
isPending == true &&
transactionDate.isPastAnchored(
anchor ?? Moment.now().endOfNextMinute(),
);
bool confirmable([DateTime? anchor]) {
if (isPending != true) return false;

bool holdable([DateTime? anchor]) =>
isPending != true &&
transactionDate.isFutureAnchored(
anchor ?? Moment.now().startOfMinute(),
);
return transactionDate.isPastAnchored(
anchor ?? Moment.now().endOfNextMinute(),
);
}

bool holdable([DateTime? anchor]) {
if (isPending != true) return false;

return transactionDate.isFutureAnchored(
anchor ?? Moment.now().startOfMinute(),
);
}
}
2 changes: 1 addition & 1 deletion lib/widgets/transaction_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class TransactionListTile extends StatelessWidget {
];

final List<SlidableAction> endActionPanes = [
if (showPendingConfirmation)
if (confirmFn != null && transaction.isPending == true)
SlidableAction(
onPressed: (context) => confirmFn!(),
icon: Symbols.check_rounded,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A personal finance managing app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: "0.9.0+86"
version: "0.9.0+87"

environment:
sdk: ">=3.5.0 <4.0.0"
Expand Down

0 comments on commit f74f4f0

Please sign in to comment.