Skip to content

Commit

Permalink
fix: #1669 - accepts both decimal points (#1679)
Browse files Browse the repository at this point in the history
Impacted file:
* `nutrition_page_loaded.dart`: now we accept both decimal points and let the keyboard decide which one is right
* `Podfile.lock`: wtf
  • Loading branch information
monsieurtanuki authored Apr 28, 2022
1 parent 0c8cd6a commit b87bfbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/smooth_app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ PODS:
- qr_code_scanner (0.2.0):
- Flutter
- MTBBarcodeScanner
- Sentry (7.10.2):
- Sentry/Core (= 7.10.2)
- Sentry/Core (7.10.2)
- Sentry (7.11.0):
- Sentry/Core (= 7.11.0)
- Sentry/Core (7.11.0)
- sentry_flutter (0.0.1):
- Flutter
- FlutterMacOS
- Sentry (~> 7.10.1)
- Sentry (~> 7.11.0)
- shared_preferences_ios (0.0.1):
- Flutter
- TOCropViewController (2.6.1)
Expand Down Expand Up @@ -203,8 +203,8 @@ SPEC CHECKSUMS:
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Protobuf: 235750e4696ff59fb07d949a9dbbc92b3c0700fe
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
Sentry: 7bf9bfe713692cf87812e55f0999260494ba7982
sentry_flutter: 77ccdac346608b8ce7e428e7284e7a3e4e7f4a02
Sentry: 0c5cd63d714187b4a39c331c1f0eb04ba7868341
sentry_flutter: efb3df2c203cd03aad255892a8d628a458656d14
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class NutritionPageLoaded extends StatefulWidget {
}

class _NutritionPageLoadedState extends State<NutritionPageLoaded> {
late final RegExp _decimalRegExp;
// we admit both decimal points
// anyway, the keyboard will only show one
static final RegExp _decimalRegExp = RegExp(r'[0-9,.]');

late final NumberFormat _numberFormat;
late final NutritionContainer _nutritionContainer;

Expand Down Expand Up @@ -55,9 +58,6 @@ class _NutritionPageLoadedState extends State<NutritionPageLoaded> {
product: widget.product,
);
_numberFormat = NumberFormat('####0.#####', ProductQuery.getLocaleString());
_decimalRegExp = _numberFormat.format(1.2).contains('.')
? RegExp(r'[0-9\.]') // TODO(monsieurtanuki): check if . or \.
: RegExp(r'[0-9,]');
}

@override
Expand Down

0 comments on commit b87bfbc

Please sign in to comment.