Questions tagged [dart-intl]

10 questions
13
votes
3 answers

Use multiple LocalizationsDelegates in Flutter

I'm facing an issue where I'm trying to use multiple LocalizationsDelegates in a MaterialApp. I'm using the Dart intl tools to provide translations to my labels. When I have multiple LocalizationsDelegates only the one that is specified the first…
dumazy
  • 13,857
  • 12
  • 66
  • 113
3
votes
1 answer

Dart intl how to omit name and arguments

I am trying to omit passing name and arguments into Intl.message. Intl documentation suggests that, there is a transformer provided that will automatically insert those parameters for you. So I added following into pubspec.yaml: dev_dependencies: …
Rostyslav Roshak
  • 3,859
  • 2
  • 35
  • 56
2
votes
1 answer

Is there a way to compare formatted value by NumberFormat?

I'm creating unit tests for a currency format using intl package last version 0.16.1. My formatter is: final currencyFormat = NumberFormat.simpleCurrency(locale: 'pt_BR'); My expected result is: var expected = r'R$ 1,00';. And I applied my formatter…
Ascension
  • 2,599
  • 2
  • 15
  • 13
1
vote
1 answer

Flutter/Dart: DateFormat (using intl): how to remove zero prefix?

I am using intl pakage's DateFormat class to format dates with a format like this: _standardDateFormat = DateFormat('MMM dd, yyyy'); This produces strings like Feb 01, 2023. How can I have the date without the prefix of 0 when it's a single-digit…
or9ob
  • 2,313
  • 4
  • 25
  • 45
1
vote
1 answer

Dart DateFormat inconsistency

I'm trying to parse date string that looks like this Feb0920221500 (month, day in month, year, hours, minutes). But when I use MMMddyyyyHmm pattern I always get a FormatException. Furthermore intl's DateFormat fails to parse back a date which it has…
KY1VSTAR
  • 395
  • 4
  • 16
1
vote
0 answers

intl DateFormat parse weird behavior

The server where I am working in some routes it returns a Date with one extra number and it was causing a weird behavior in our application. Then I isolated the weird behavior to the following code: import 'package:intl/intl.dart'; void main() { …
Leonardo da Silva
  • 1,285
  • 2
  • 10
  • 25
1
vote
0 answers

How to get a localized, pluralized date part?

Curious how I can get a localized, plural part of any date. e.g "Octobers, Novembers" or "Mondays, Tuesdays"
E-Madd
  • 4,414
  • 5
  • 45
  • 77
0
votes
1 answer

Getting errors when intl is imported

When i add intl: ^0.17.0 to pubspec.yaml i get the following errors: ../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/intl_browser.dart:12:8: Error: Not found: 'dart:html' import 'dart:html'; …
0
votes
1 answer

How to show eras in DateFormat?

I'm not looking for something powerful, for date format DateFormat is enough but i need to add A.D or B.C like in Anno Domini for dates. Now i know it's not even a challenge to customize it but I'm looking for best way to do it with the official…
OverLoadedBurden
  • 606
  • 1
  • 5
  • 14
0
votes
1 answer

error when trying to change DateTime to string that has time zone format in dart

so I use intl package. here is my code import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; String toString(DateTime originalDate) { initializeDateFormatting(); final DateFormat formatter = DateFormat("EEEE, d…
Alexa289
  • 8,089
  • 10
  • 74
  • 178