I want to show double numbers with "," as decimal separator and have to convert strings to double considering the same issue. I do this using the intl package.
Get Locale: String myLocale = await findSystemLocale()
Define Numberformat: myNumberFormat = NumberFormat("##0.00", myLocale);
Read: numberFormat.parse(value.text).toDouble()
Show: numberFormat.format(item.price)
That works fine until I debug it not using "Chrome - web" but "Linux - desktop". Then I get this error:
Invalid depfile: /home/User/Repositories/Cashier/.dart_tool/flutter_build/19fc9eb7bd361f82815989439418e9d9/kernel_snapshot_program.d
ERROR: ../../.pub-cache/hosted/pub.dev/intl-0.20.2/lib/src/web.dart:9:8: Error: Dart library 'dart:js_interop' is not available on this platform.
web.dart:9
ERROR: import 'dart:js_interop';
ERROR: ^
ERROR: Context: The unavailable library 'dart:js_interop' is imported through these packages:
ERROR: package:calculator => package:intl => dart:js_interop
ERROR: Detailed import paths for (some of) the these imports:
ERROR: package:calculator/main.dart => package:intl/intl_browser.dart => package:intl/src/web.dart => dart:js_interop
(a lot more lines)
ERROR: Unhandled exception:
ERROR: Target kernel_snapshot_program failed: Exception
Error: Build process failed
Is this trying to tell me that intl is not available on Linux Mint 22.2? What else can I do to get the locale and convert double to strings back and forth?
environment: sdk: ^3.9.0 dependencies: flutter_bloc: ^9.0.0 bloc: ^9.0.0 flutter: sdk: flutter provider: ^6.1.5+1 hive_ce: hive_ce_flutter: intl: ^0.20.2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^5.0.0 hive_ce_generator: build_runner: flutter: uses-material-design: trueimport 'package:intl/intl_browser.dart'a culprit? tried to remove that just for test?intl_browseris causing the issue. I used that for getting the locale. I now usedintl/find_localeinstead. Can you explain the issue to a dart beginner like me? And how did you know that this might be the issue?