Skip to content

Commit

Permalink
4.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Macacoazul01 committed Nov 7, 2024
1 parent 01bf175 commit 2ddaa22
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.14.1] - 2024-11-07
- Fixed bugs.
- Added tests.

## [4.14.0] - 2024-11-07
- Added missing min value check.
- Fixed zero not being deleted if `showZeroValue` parameter is true.[23](https://github.com/IsaiasSantana/currency_textfield/issues/23)
Expand Down
7 changes: 1 addition & 6 deletions lib/currency_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,10 @@ class CurrencyTextFieldController extends TextEditingController {
_value = 0;
_isNegative = forceNegative;

if (_showZeroValue) {
_changeText();
} else {
_previewsText = '';
}

if (_resetSeparator && _startWithSeparator) {
_startWithSeparator = false;
}
_changeText();
}

bool _checkCleanZeroText(String currentText) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: currency_textfield
description: A flutter package that implements a Controller for currency text input.
version: 4.14.0
version: 4.14.1
homepage: https://github.com/IsaiasSantana/currency_textfield
environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
8 changes: 8 additions & 0 deletions test/currency_textfield_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,12 @@ void main() {
expect(controller.intValue, 30000);
expect(controller.doubleTextWithoutCurrencySymbol, '300.00');
});

test('clear_zero_value', () {
final controller =
CurrencyTextFieldController(initIntValue: 0, showZeroValue: true);

controller.clear();
expect(controller.text, "");
});
}

0 comments on commit 2ddaa22

Please sign in to comment.