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

Money initial null value #32

Open
wants to merge 3 commits into
base: 0.8.1
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Next Next commit
fix(money): when initialValue is explicitly null
  • Loading branch information
jogboms committed May 19, 2019
commit b193fb1817c7b6cc3b8fb923f00043e328d88b61
5 changes: 5 additions & 0 deletions lib/flutter_masked_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ class MoneyMaskedTextController extends TextEditingController {
double _lastValue = 0.0;

void updateValue(double value) {
if (value == null) {
_lastValue = value;
return;
}

double valueToUse = value;

if (value.toStringAsFixed(0).length > 12) {
Expand Down