-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Describe the bug
NumberFormat.decimalPattern(locale) only respects locale defaults and ignores OS-level number format overrides.
On iOS (and sometimes Android), users can change their number formatting style in system settings (e.g. use . as grouping and , as decimal).
In such cases, parsing fails because intl expects the default locale pattern, not the one actually configured in the OS.
To Reproduce
Steps to reproduce the behavior:
import 'dart:ui' as ui;
import 'package:intl/intl.dart';
void main(List<String> arguments) {
final locale = ui.PlatformDispatcher.instance.locale.toLanguageTag();
final formatter = NumberFormat.decimalPattern(locale);
// Simulate iOS device with locale "fr_FR"
// but user manually set "1,234,567.89" format in system settings.
final input = "1,234,567.89";
try {
final value = formatter.parse(input);
print("Parsed: $value");
} catch (e) {
print("Parsing failed: $e");
}
}Expected behavior
Should parse successfully according to the actual OS number format settings (1234567.89).
Actual behavior
Throws an exception because intl only accepts "1 234 567,89" for fr_FR.
num.tryParse("1.234.567,89") also fails.
System info
Dart SDK 3.9.0
Flutter SDK 3.35.2
fitmetrics_app 1.0.12+56
dependencies:
- app_tracking_transparency 2.0.6+1 [flutter]
- bloc_concurrency 0.3.0 [bloc stream_transform]
- cached_network_image 3.4.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image]
- collection 1.19.1
- connectivity_plus 6.1.5 [flutter flutter_web_plugins connectivity_plus_platform_interface web meta nm collection]
- crypto 3.0.6 [typed_data]
- cupertino_icons 1.0.8
- date_field 6.0.3+1 [flutter intl]
- device_info_plus 11.5.0 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta web win32 win32_registry]
- dio 5.9.0 [async collection http_parser meta mime path dio_web_adapter]
- dio_cache_interceptor 4.0.3 [dio http_cache_core]
- duration 4.0.3
- easy_localization 3.0.8 [flutter shared_preferences intl args path easy_logger flutter_localizations]
- firebase_analytics 12.0.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 4.0.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 5.0.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_messaging 16.0.0 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_performance 0.11.0 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_animate 4.5.2 [flutter flutter_shaders]
- flutter_bloc 9.1.1 [bloc flutter provider]
- flutter_dotenv 6.0.0 [flutter]
- flutter_inappwebview 6.2.0-beta.2 [flutter flutter_inappwebview_platform_interface flutter_inappwebview_android flutter_inappwebview_ios flutter_inappwebview_macos flutter_inappwebview_web flutter_inappwebview_windows]
- flutter_launcher_icons 0.14.4 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_native_splash 2.4.6 [args flutter flutter_web_plugins html image meta path universal_io xml yaml ansicolor]
- flutter_platform_widgets 9.0.0 [flutter cupertino_icons]
- flutter_speed_dial 7.0.0 [flutter]
- flutter_stepindicator 0.1.7 [flutter]
- flutter_svg 2.2.0 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler]
- form_validator 2.1.1
- freezed_annotation 3.1.0 [collection json_annotation meta]
- get_it 8.2.0 [async collection meta]
- go_router 16.2.0 [collection flutter flutter_web_plugins logging meta]
- google_mobile_ads 6.0.0 [meta flutter webview_flutter_android webview_flutter_wkwebview webview_flutter]
- google_sign_in 6.3.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- hive 2.2.3 [meta crypto]
- http_cache_hive_store 5.0.1 [http_cache_core hive_ce]
- hydrated_bloc 10.1.1 [bloc hive_ce meta synchronized]
- in_app_purchase 3.2.3 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit]
- in_app_purchase_android 0.4.0+4 [collection flutter in_app_purchase_platform_interface]
- in_app_review 2.0.10 [flutter in_app_review_platform_interface]
- infinite_scroll_pagination 5.1.1 [flutter flutter_staggered_grid_view sliver_tools collection meta]
- injectable 2.5.1 [get_it meta]
- json_annotation 4.9.0 [meta]
- jwt_decoder 2.0.1
- like_button 2.1.0 [flutter]
- logging 1.3.0
- lottie 3.3.1 [archive flutter http path vector_math]
- package_info_plus 8.3.1 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock]
- path_drawing 1.0.1 [vector_math meta path_parsing flutter]
- path_provider 2.1.5 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- permission_handler 12.0.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_html permission_handler_windows permission_handler_platform_interface]
- scrollable_positioned_list 0.3.8 [flutter collection]
- share_plus 11.1.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32]
- shared_preferences 2.5.3 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- shimmer 3.0.0 [flutter]
- sign_in_with_apple 7.0.1 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web]
- talker_dio_logger 5.0.0 [dio talker]
- upgrader 11.5.0 [flutter device_info_plus html http os_detect package_info_plus shared_preferences url_launcher version xml]
- url_launcher 6.3.2 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- vector_math 2.2.0
- wakelock_plus 1.3.2 [flutter flutter_web_plugins meta wakelock_plus_platform_interface win32 dbus package_info_plus web]
- youtube_player_flutter 9.1.2 [flutter flutter_inappwebview]
dev dependencies:
- args 2.7.0
- build_runner 2.7.0 [args async build build_config build_daemon build_runner_core code_builder crypto dart_style frontend_server_client glob graphs http_multi_server io logging mime path pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel]
- flutter_gen 5.11.0 [flutter_gen_core args logging]
- flutter_lints 6.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing collection meta stream_channel]
- freezed 3.2.0 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation dart_style pub_semver]
- injectable_generator 2.8.1 [build source_gen path glob analyzer code_builder dart_style injectable collection recase meta]
- json_serializable 6.11.0 [analyzer async build build_config dart_style json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- path 1.9.1
- process_run 1.2.4 [path collection string_scanner yaml meta args pub_semver synchronized]
- xml 6.6.1 [collection meta petitparser]
transitive dependencies:
- _fe_analyzer_shared 85.0.0 [meta]
- _flutterfire_internals 1.3.60 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 7.7.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- ansicolor 2.0.3
- archive 4.0.7 [crypto path posix]
- async 2.13.0 [collection meta]
- bloc 9.0.0 [meta]
- boolean_selector 2.1.2 [source_span string_scanner]
- build 3.0.2 [analyzer async build_runner_core built_collection built_value convert crypto glob graphs logging meta package_config path]
- build_config 1.2.0 [checked_yaml json_annotation path pubspec_parse]
- build_daemon 4.0.4 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 3.0.2 [analyzer async build build_runner_core collection package_config path pool pub_semver]
- build_runner_core 9.3.0 [analyzer async build build_config build_resolvers build_runner built_collection built_value collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.11.1 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 4.1.1 [flutter flutter_cache_manager]
- cached_network_image_web 1.3.1 [cached_network_image_platform_interface flutter flutter_cache_manager web]
- characters 1.4.0
- checked_yaml 2.0.4 [json_annotation source_span yaml]
- cli_util 0.4.2 [meta path]
- clock 1.1.2
- code_builder 4.10.1 [built_collection built_value collection matcher meta]
- color 3.0.0
- connectivity_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- convert 3.1.2 [typed_data]
- cross_file 0.3.4+2 [meta web]
- csslib 1.0.2 [source_span]
- dart_style 3.1.1 [analyzer args collection package_config path pub_semver source_span yaml]
- dartx 1.2.0 [characters collection crypto meta path time]
- dbus 0.7.11 [args ffi meta xml]
- device_info_plus_platform_interface 7.0.3 [flutter meta plugin_platform_interface]
- dio_web_adapter 2.1.1 [dio http_parser meta web]
- easy_logger 0.0.2 [flutter]
- fake_async 1.3.3 [clock collection]
- ffi 2.1.4
- file 7.0.1 [meta path]
- firebase_analytics_platform_interface 5.0.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.6.0 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- firebase_core_platform_interface 6.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 3.0.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.8.11 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 4.7.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 4.0.0 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web]
- firebase_performance_platform_interface 0.1.5+11 [_flutterfire_internals firebase_core flutter plugin_platform_interface]
- firebase_performance_web 0.1.7+17 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins]
- fixnum 1.1.1
- flutter_cache_manager 3.4.1 [clock collection file flutter http path path_provider rxdart sqflite uuid]
- flutter_gen_core 5.11.0 [meta path yaml mime xml dartx color collection json_annotation glob logging dart_style archive args pub_semver vector_graphics_compiler image_size_getter image]
- flutter_inappwebview_android 1.2.0-beta.2 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_internal_annotations 1.2.0
- flutter_inappwebview_ios 1.2.0-beta.2 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_macos 1.2.0-beta.2 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_platform_interface 1.4.0-beta.2 [flutter flutter_inappwebview_internal_annotations plugin_platform_interface]
- flutter_inappwebview_web 1.2.0-beta.2 [flutter flutter_web_plugins web flutter_inappwebview_platform_interface]
- flutter_inappwebview_windows 0.7.0-beta.2 [flutter flutter_inappwebview_platform_interface]
- flutter_localizations 0.0.0 [flutter intl path]
- flutter_shaders 0.1.3 [flutter vector_math]
- flutter_staggered_grid_view 0.7.0 [flutter]
- flutter_web_plugins 0.0.0 [flutter]
- frontend_server_client 4.0.0 [async path]
- glob 2.1.3 [async collection file path string_scanner]
- google_identity_services_web 0.3.3+1 [meta web]
- google_sign_in_android 6.2.1 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.9.0 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.5.0 [flutter plugin_platform_interface]
- google_sign_in_web 0.12.4+4 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http web]
- graphs 2.3.2 [collection]
- hashcodes 2.0.0
- hive_ce 2.11.3 [meta crypto web isolate_channel json_annotation]
- html 0.15.6 [csslib source_span]
- http 1.5.0 [async http_parser meta web]
- http_cache_core 1.1.1 [collection string_scanner uuid]
- http_multi_server 3.2.2 [async]
- http_parser 4.1.2 [collection source_span string_scanner typed_data]
- image 4.5.4 [archive meta xml]
- image_size_getter 2.4.1 [collection hashcodes meta]
- in_app_purchase_platform_interface 1.4.0 [flutter plugin_platform_interface]
- in_app_purchase_storekit 0.4.4 [collection flutter in_app_purchase_platform_interface json_annotation]
- in_app_review_platform_interface 2.0.5 [flutter url_launcher plugin_platform_interface platform]
- intl 0.20.2 [clock meta path]
- io 1.0.5 [meta path string_scanner]
- isolate_channel 0.2.2+1
- leak_tracker 11.0.1 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.10 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.2 [leak_tracker matcher meta]
- lints 6.0.0
- matcher 0.12.17 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.16.0
- mime 2.0.0
- nested 1.0.0 [flutter]
- nm 0.5.0 [dbus]
- octo_image 2.1.0 [flutter]
- os_detect 2.0.3 [meta web]
- package_config 2.2.0 [path]
- package_info_plus_platform_interface 3.2.1 [flutter meta plugin_platform_interface]
- path_parsing 1.1.0 [meta vector_math]
- path_provider_android 2.2.18 [flutter path_provider_platform_interface]
- path_provider_foundation 2.4.2 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface]
- permission_handler_android 13.0.1 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.4.7 [flutter permission_handler_platform_interface]
- permission_handler_html 0.1.3+5 [flutter flutter_web_plugins permission_handler_platform_interface web]
- permission_handler_platform_interface 4.3.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.2.1 [flutter permission_handler_platform_interface]
- petitparser 7.0.1 [meta collection]
- platform 3.1.6
- plugin_platform_interface 2.1.8 [meta]
- pool 1.5.1 [async stack_trace]
- posix 6.0.3 [ffi meta path]
- provider 6.1.5+1 [collection flutter nested]
- pub_semver 2.2.0 [collection]
- pubspec_parse 1.5.0 [checked_yaml collection json_annotation pub_semver yaml]
- recase 4.1.0
- rxdart 0.28.0
- share_plus_platform_interface 6.1.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.4.12 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.5.4 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.4.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.4.1 [flutter plugin_platform_interface]
- shared_preferences_web 2.4.3 [flutter flutter_web_plugins shared_preferences_platform_interface web]
- shared_preferences_windows 2.4.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.2 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 3.0.0 [shelf stream_channel web_socket_channel]
- sign_in_with_apple_platform_interface 2.0.0 [flutter plugin_platform_interface meta]
- sign_in_with_apple_web 3.0.0 [flutter flutter_web_plugins sign_in_with_apple_platform_interface]
- sky_engine 0.0.0
- sliver_tools 0.2.12 [flutter]
- source_gen 3.1.0 [analyzer async build dart_style glob path pub_semver source_span yaml]
- source_helper 1.3.7 [analyzer source_gen]
- source_span 1.10.1 [collection path term_glyph]
- sprintf 7.0.0
- sqflite 2.4.2 [flutter sqflite_android sqflite_darwin sqflite_platform_interface sqflite_common path]
- sqflite_android 2.4.2+2 [flutter sqflite_common path sqflite_platform_interface]
- sqflite_common 2.5.6 [synchronized path meta]
- sqflite_darwin 2.4.2 [flutter sqflite_platform_interface meta sqflite_common path]
- sqflite_platform_interface 2.4.0 [flutter platform sqflite_common plugin_platform_interface meta]
- stack_trace 1.12.1 [path]
- stream_channel 2.1.4 [async]
- stream_transform 2.1.1
- string_scanner 1.4.1 [source_span]
- synchronized 3.4.0
- talker 5.0.0 [talker_logger]
- talker_logger 5.0.0 [ansicolor web]
- term_glyph 1.2.2
- test_api 0.7.6 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- time 2.1.5 [clock]
- timing 1.0.2 [json_annotation]
- typed_data 1.4.0 [collection]
- universal_io 2.2.2 [collection meta typed_data]
- url_launcher_android 6.3.18 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.3.4 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.2.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.2.3 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
- url_launcher_web 2.4.1 [flutter flutter_web_plugins url_launcher_platform_interface web]
- url_launcher_windows 3.1.4 [flutter url_launcher_platform_interface]
- uuid 4.5.1 [crypto sprintf meta fixnum]
- vector_graphics 1.1.19 [flutter http vector_graphics_codec]
- vector_graphics_codec 1.1.13
- vector_graphics_compiler 1.1.19 [args meta path path_parsing vector_graphics_codec xml]
- version 3.0.2
- vm_service 15.0.2
- wakelock_plus_platform_interface 1.2.3 [flutter plugin_platform_interface meta]
- watcher 1.1.3 [async path]
- web 1.1.1
- web_socket 1.0.1 [web]
- web_socket_channel 3.0.3 [async crypto stream_channel web web_socket]
- webview_flutter 4.13.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]
- webview_flutter_android 4.10.1 [flutter meta webview_flutter_platform_interface]
- webview_flutter_platform_interface 2.14.0 [flutter meta plugin_platform_interface]
- webview_flutter_wkwebview 3.23.0 [flutter meta path webview_flutter_platform_interface]
- win32 5.14.0 [ffi]
- win32_registry 2.1.0 [ffi meta win32]
- xdg_directories 1.1.0 [meta path]
- yaml 3.1.3 [collection source_span string_scanner]
mosuem
Metadata
Metadata
Assignees
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)