### Install intl4x package Source: https://pub.dev/documentation/intl4x/latest/index.html Add the package to your project using the Dart CLI. ```bash dart pub add intl4x ``` -------------------------------- ### Currency Formatting Example Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.currency.html Basic usage of the NumberFormat.currency constructor to format a numeric value as USD. ```dart import 'package:intl4x/number_format.dart'; void main() { print(NumberFormat.currency(currency: 'USD').format(123.45)); // Prints '$123.45' } ``` -------------------------------- ### Compact Number Formatting Example Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.compact.html Demonstrates basic usage of the compact formatter to convert a large integer into a human-readable string. ```dart import 'package:intl4x/number_format.dart'; void main() { print(NumberFormat.compact().format(1234567)); // Prints '1.2M' } ``` -------------------------------- ### String get name Source: https://pub.dev/documentation/intl4x/latest/number_format/DecimalStyle/name.html Retrieves the name of the decimal style. ```APIDOC ## name ### Description Returns the name of the decimal style as a String. ### Signature `String get name` ### Returns - **String**: The string 'decimal'. ``` -------------------------------- ### Get Display Names Source: https://pub.dev/documentation/intl4x/latest/index.html Retrieve localized names for locales, regions, scripts, and currencies. ```dart import 'package:intl4x/display_names.dart'; void main() { final displayNames = DisplayNames(locale: Locale.parse('en')); print(displayNames.ofLocale(Locale.parse('fr-CA'))); // "Canadian French" print(displayNames.ofRegion('419')); // "Latin America" } ``` -------------------------------- ### Using joinAnd for list formatting Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinAnd.html Demonstrates the basic usage of joinAnd to format a list of strings into a human-readable format. ```dart import 'package:intl4x/list_format.dart'; void main() { print(['A', 'B', 'C'].joinAnd()); // Prints 'A, B, and C' } ``` -------------------------------- ### Initialize DisplayNames Source: https://pub.dev/documentation/intl4x/latest/display_names/DisplayNames/DisplayNames.html Constructor for creating a new display name formatter with specific locale and formatting options. ```dart DisplayNames({ Locale? locale, Style style = Style.long, LanguageDisplay languageDisplay = LanguageDisplay.dialect, Fallback fallback = Fallback.code, }) ``` ```dart DisplayNames({ Locale? locale, Style style = Style.long, LanguageDisplay languageDisplay = LanguageDisplay.dialect, Fallback fallback = Fallback.code, }) : _impl = DisplayNamesImpl.build( locale ?? findSystemLocale(), DisplayNamesOptions( style: style, languageDisplay: languageDisplay, fallback: fallback, ), ); ``` -------------------------------- ### CompactNotation constructor Source: https://pub.dev/documentation/intl4x/latest/number_format/CompactNotation/CompactNotation.html Initializes a new instance of the CompactNotation class with a specified compact display style. ```APIDOC ## CompactNotation constructor ### Description Creates a new instance of the CompactNotation class to configure how numbers are displayed in compact notation. ### Constructor Signature `CompactNotation({CompactDisplay compactDisplay = CompactDisplay.short})` ### Parameters - **compactDisplay** (CompactDisplay) - Optional - Defines the display style for the compact notation. Defaults to `CompactDisplay.short`. ``` -------------------------------- ### bool get is12Hour Source: https://pub.dev/documentation/intl4x/latest/datetime_format/ClockStyle/is12Hour.html Returns true if the clock style is either zeroToEleven or oneToTwelve, indicating a 12-hour format. ```APIDOC ## bool get is12Hour ### Description Returns a boolean value indicating whether the current ClockStyle represents a 12-hour clock. It evaluates to true if the style is set to zeroToEleven or oneToTwelve. ### Signature `bool get is12Hour` ``` -------------------------------- ### Using NumberFormat for Locale-Specific Formatting Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.html Demonstrates how to instantiate NumberFormat with a specific locale and fraction digit configuration. ```dart import 'package:intl4x/number_format.dart'; void main() { print(NumberFormat(locale: Locale('de'), style: DecimalStyle(digits: FractionDigits(2, 2))).format(1234.567)); // Prints '1.234,57' } ``` -------------------------------- ### Retrieve localized region name Source: https://pub.dev/documentation/intl4x/latest/display_names/DisplayNames/ofRegion.html Demonstrates basic usage of the ofRegion method to get the display name for a region code. ```dart import 'package:intl4x/display_names.dart'; void main() { print(DisplayNames.ofRegion('DE')); // Prints 'Germany' } ``` -------------------------------- ### Basic usage of joinUnit Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinUnit.html Demonstrates joining a list of strings into a single formatted string using default locale settings. ```dart import 'package:intl4x/list_format.dart'; void main() { print(['A', 'B', 'C'].joinUnit()); // Prints 'A, B, C' } ``` -------------------------------- ### Format day using DateTimeFormat Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/day.html Demonstrates how to use the day method to extract and format the day from a DateTime instance. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.day().format(date)); // Output: '17' } ``` -------------------------------- ### compactDisplay Property Source: https://pub.dev/documentation/intl4x/latest/number_format/CompactNotation-class.html Retrieves the current compact display setting for the instance. ```APIDOC ## compactDisplay ### Description Returns the `CompactDisplay` configuration currently set for this instance. ### Returns - **CompactDisplay** - The display style used for formatting. ``` -------------------------------- ### PercentStyle() Source: https://pub.dev/documentation/intl4x/latest/number_format/PercentStyle-class.html Constructor for creating a new instance of the PercentStyle class. ```APIDOC ## PercentStyle() ### Description Creates a new instance of the PercentStyle class to format numbers as percentages. ### Constructor `const PercentStyle()` ``` -------------------------------- ### Implementation of joinAnd Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinAnd.html Shows the underlying implementation of the joinAnd extension method using ListFormat. ```dart String joinAnd({Locale? locale}) => ListFormat(locale: locale, type: ListType.and).format(this); ``` -------------------------------- ### NumberFormat.compact Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.compact.html The internal implementation of the compact constructor, showing how it builds the formatter using NumberFormatImpl. ```dart //TODO: implement in ICU4X NumberFormat.compact({ Locale? locale, CompactDisplay compactDisplay = CompactDisplay.short, //General options FormatStyle style = const DecimalStyle(), SignDisplay signDisplay = SignDisplay.auto, Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits, }) : _impl = NumberFormatImpl.build( locale ?? findSystemLocale(), NumberFormatOptions.compact( compactDisplay: compactDisplay, digits: digits, minimumIntegerDigits: minimumIntegerDigits, numberingSystem: numberingSystem, roundingMode: roundingMode, signDisplay: signDisplay, style: style, trailingZeroDisplay: trailingZeroDisplay, useGrouping: useGrouping, ), ); ``` -------------------------------- ### Implementation of monthDayTime Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/monthDayTime.html Internal implementation details showing how the method builds the formatter using the system locale and provided parameters. ```dart static DateTimeFormatter monthDayTime({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).mdt(alignment: alignment, length: length, timePrecision: timePrecision); ``` -------------------------------- ### Initialize CurrencyStyle Source: https://pub.dev/documentation/intl4x/latest/number_format/CurrencyStyle/CurrencyStyle.html Constructs a new CurrencyStyle instance with the required currency code and optional sign and display settings. ```dart CurrencyStyle({ required this.currency, this.sign = CurrencySign.standard, this.display = CurrencyDisplay.symbol, }); ``` -------------------------------- ### CompactNotation Constructor Source: https://pub.dev/documentation/intl4x/latest/number_format/CompactNotation-class.html Creates a new instance of the CompactNotation class with an optional compact display setting. ```APIDOC ## CompactNotation({CompactDisplay compactDisplay = CompactDisplay.short}) ### Description Initializes a new instance of the CompactNotation class. The `compactDisplay` parameter determines the style of the compact notation (e.g., short or long). ### Parameters - **compactDisplay** (CompactDisplay) - Optional - The display style for the compact notation. Defaults to `CompactDisplay.short`. ``` -------------------------------- ### Implementation of joinUnit Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinUnit.html Shows the underlying implementation of the joinUnit extension method using ListFormat. ```dart String joinUnit({Locale? locale}) => ListFormat(locale: locale, type: ListType.unit).format(this); ``` -------------------------------- ### ListFormat constructor Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormat/ListFormat.html Creates a new list formatter instance with specified locale, type, and style configurations. ```APIDOC ## ListFormat constructor ### Description Creates a new list formatter instance to handle list concatenation based on locale-specific rules. ### Signature ListFormat({Locale? locale, ListType type = ListType.and, ListStyle style = ListStyle.long}) ### Parameters - **locale** (Locale?) - Optional - The locale defining the formatting rules. If null, the system locale is used. - **type** (ListType) - Optional - Specifies the type of list concatenation. Defaults to ListType.and. Can be ListType.or. - **style** (ListStyle) - Optional - The formatting style, such as ListStyle.long or ListStyle.short. Defaults to ListStyle.long. ``` -------------------------------- ### Using compareLocale for string comparison Source: https://pub.dev/documentation/intl4x/latest/collation/CollationExt/compareLocale.html Demonstrates basic usage of compareLocale with and without specific locale settings. ```dart import 'package:intl4x/collation.dart'; void main() { print('a'.compareLocale('b')); // Prints -1 print('ä'.compareLocale('z', locale: Locale('de'))); // Prints -1 print('ä'.compareLocale('z', locale: Locale('sv'))); // Prints 1 } ``` -------------------------------- ### Locale.withNumberingSystem(NumberingSystem system) Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withNumberingSystem.html Returns a new Locale instance configured with the provided numbering system. ```APIDOC ## Locale.withNumberingSystem ### Description Returns a new `Locale` instance with the specified `NumberingSystem` applied. ### Signature `Locale withNumberingSystem(NumberingSystem system)` ### Parameters - **system** (NumberingSystem) - Required - The numbering system to be applied to the new Locale. ``` -------------------------------- ### Implement withClockStyle method Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withClockStyle.html Defines the abstract method signature for setting the clock style on a Locale instance. ```dart Locale withClockStyle(ClockStyle clockStyle); ``` -------------------------------- ### Initialize ListFormat Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormat/ListFormat.html The constructor accepts optional locale, type, and style parameters to configure list concatenation behavior. ```dart ListFormat({ Locale? locale, ListType type = ListType.and, ListStyle style = ListStyle.long, }) ``` ```dart ListFormat({ Locale? locale, ListType type = ListType.and, ListStyle style = ListStyle.long, }) : _listFormatImpl = ListFormatImpl.build( locale ?? findSystemLocale(), ListFormatOptions(type: type, style: style), ); ``` -------------------------------- ### ListFormat(Locale? locale, ListType type, ListStyle style) Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormat-class.html Constructor to create a new list formatter instance with specified locale, list type, and style. ```APIDOC ## Constructor: ListFormat ### Description Creates a new list formatter instance. ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting rules. - **type** (ListType) - Optional - The type of list (e.g., ListType.and). Defaults to ListType.and. - **style** (ListStyle) - Optional - The style of the list (e.g., ListStyle.long). Defaults to ListStyle.long. ``` -------------------------------- ### DisplayNames constructor Source: https://pub.dev/documentation/intl4x/latest/display_names/DisplayNames/DisplayNames.html Initializes a new instance of the DisplayNames formatter with specified locale and formatting options. ```APIDOC ## DisplayNames constructor ### Description Creates a new display name formatter configured for a specific locale and set of display options. ### Signature DisplayNames({Locale? locale, Style style = Style.long, LanguageDisplay languageDisplay = LanguageDisplay.dialect, Fallback fallback = Fallback.code}) ### Parameters - **locale** (Locale?) - Optional - The locale whose language is used to format the names. If null, the system's current locale is used. - **style** (Style) - Optional - The desired length of the name (e.g., Style.long or Style.short). Defaults to Style.long. - **languageDisplay** (LanguageDisplay) - Optional - Controls how language names are displayed, such as including the dialect or region. Defaults to LanguageDisplay.dialect. - **fallback** (Fallback) - Optional - Specifies the behavior if a display name is not available for a code. Defaults to Fallback.code. ``` -------------------------------- ### Format month, day, and time Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/monthDayTime.html Demonstrates basic usage of the monthDayTime formatter to output a date string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.monthDayTime().format(date)); // Output: 'Dec 17, 4:00 AM' } ``` -------------------------------- ### CaseMapping constructor Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMapping/CaseMapping.html Initializes a new CaseMapping instance. If no locale is provided, it defaults to the system locale. ```APIDOC ## CaseMapping constructor ### Description Constructs a CaseMapping instance for the given locale. If the locale is not provided, the system's locale is used. ### Signature CaseMapping({Locale? locale}) ### Parameters - **locale** (Locale?) - Optional - The locale to use for case mapping rules. If null, the system locale is used. ``` -------------------------------- ### Initialize Collation Instance Source: https://pub.dev/documentation/intl4x/latest/collation/Collation/Collation.html The constructor initializes a new Collation instance by mapping provided parameters to a CollationImpl, defaulting to the system locale if none is specified. ```dart Collation({ Locale? locale, Usage usage = Usage.sort, Sensitivity? sensitivity, bool ignorePunctuation = false, bool? numeric, CaseFirst? caseFirst, String? collation, }) : _collationImpl = CollationImpl.build( locale ?? findSystemLocale(), CollationOptions( usage: usage, sensitivity: sensitivity, ignorePunctuation: ignorePunctuation, numeric: numeric, caseFirst: caseFirst, collation: collation, ), ); ``` -------------------------------- ### Implementation of the format method Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormat/format.html Internal implementation logic for the format method, handling test environments and locale-specific formatting. ```dart String format(List list) { if (isInTest) { return '${list.join(', ')}//${_listFormatImpl.locale}'; } else { return _listFormatImpl.formatImpl(list); } } ``` -------------------------------- ### Using joinOr for list formatting Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinOr.html Demonstrates the basic usage of joinOr to format a list of strings with an 'or' conjunction. ```dart import 'package:intl4x/list_format.dart'; void main() { print(['A', 'B', 'C'].joinOr()); // Prints 'A, B, or C' } ``` -------------------------------- ### Implement withCalendar method Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withCalendar.html Defines the abstract method signature for setting a calendar on a Locale instance. ```dart Locale withCalendar(Calendar calendar); ``` -------------------------------- ### UnitStyle.new Source: https://pub.dev/documentation/intl4x/latest/number_format/UnitStyle/UnitStyle.html Creates a new instance of UnitStyle with a required unit and an optional display style. ```APIDOC ## UnitStyle.new ### Description Creates a new UnitStyle instance to configure how units are displayed during number formatting. ### Constructor Signature `const UnitStyle({required Unit unit, UnitDisplay unitDisplay = UnitDisplay.short})` ### Parameters - **unit** (Unit) - Required - The unit to be used for formatting. - **unitDisplay** (UnitDisplay) - Optional - The display style for the unit. Defaults to `UnitDisplay.short`. ``` -------------------------------- ### DisplayNames Constructor Source: https://pub.dev/documentation/intl4x/latest/display_names/DisplayNames-class.html Creates a new display name formatter configured for a specific locale and formatting options. ```APIDOC ## DisplayNames({Locale? locale, Style style = Style.long, LanguageDisplay languageDisplay = LanguageDisplay.dialect, Fallback fallback = Fallback.code}) ### Description Creates a new display name formatter configured for a specific locale and formatting options. ``` -------------------------------- ### Format a date using yearMonthDay Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/yearMonthDay.html Demonstrates basic usage of the yearMonthDay formatter to output a date string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.yearMonthDay().format(date)); // Output: 'Dec 17, 2021' } ``` -------------------------------- ### Implementation of compare method Source: https://pub.dev/documentation/intl4x/latest/collation/Collation/compare.html Shows the internal logic for the compare method, switching between test and implementation modes. ```dart int compare(String a, String b) { if (isInTest) { return a.compareTo(b); } else { return _collationImpl.compareImpl(a, b); } } ``` -------------------------------- ### CompactNotation Constructor Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/CompactNotation/CompactNotation.html The constructor initializes the compact display style, defaulting to short notation. ```dart CompactNotation({this.compactDisplay = CompactDisplay.short}); ``` -------------------------------- ### Implementation of year static method Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/year.html Shows the internal implementation of the year method, which builds a formatter using the system locale and specified alignment, length, and style. ```dart static DateTimeFormatterStandalone year({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, YearStyle? yearStyle, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).y(alignment: alignment, length: length, yearStyle: yearStyle); ``` -------------------------------- ### Initialize DecimalStyle Source: https://pub.dev/documentation/intl4x/latest/number_format/DecimalStyle/DecimalStyle.html Use the constant constructor to create a new DecimalStyle instance. ```dart const DecimalStyle(); ``` -------------------------------- ### Format month and day using DateTimeFormat Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/monthDay.html Demonstrates how to use the monthDay method to format a DateTime object into a string representation of the month and day. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.monthDay().format(date)); // Output: 'Dec 17' } ``` -------------------------------- ### CurrencyStyle Constructor Source: https://pub.dev/documentation/intl4x/latest/number_format/CurrencyStyle-class.html Creates a new instance of CurrencyStyle to define how a number should be formatted as a currency. ```APIDOC ## Constructor ### CurrencyStyle `CurrencyStyle({required String currency, CurrencySign sign = CurrencySign.standard, CurrencyDisplay display = CurrencyDisplay.symbol})` ### Parameters - **currency** (String) - Required - The currency code (e.g., 'USD'). - **sign** (CurrencySign) - Optional - The sign style (defaults to CurrencySign.standard). - **display** (CurrencyDisplay) - Optional - The display format (defaults to CurrencyDisplay.symbol). ``` -------------------------------- ### DecimalStyle() Source: https://pub.dev/documentation/intl4x/latest/number_format/DecimalStyle/DecimalStyle.html Creates a new instance of DecimalStyle using the constant constructor. ```APIDOC ## DecimalStyle() ### Description Creates a new instance of the DecimalStyle class. ### Signature `const DecimalStyle()` ``` -------------------------------- ### PercentStyle() Source: https://pub.dev/documentation/intl4x/latest/number_format/PercentStyle/PercentStyle.html Creates a new instance of the PercentStyle class. ```APIDOC ## PercentStyle() ### Description Creates a new constant instance of the PercentStyle class. ### Constructor `const PercentStyle()` ``` -------------------------------- ### FractionDigits.new Source: https://pub.dev/documentation/intl4x/latest/number_format/FractionDigits/FractionDigits.html Creates a new instance of FractionDigits with optional minimum and maximum constraints. ```APIDOC ## FractionDigits.new ### Description Creates a FractionDigits instance with optional minimum and maximum fraction digits. Both values must be between 0 and 20, inclusive, and if both are provided, the minimum must be less than or equal to the maximum. ### Signature `const FractionDigits({int? minimum, int? maximum})` ### Parameters - **minimum** (int?) - Optional - The minimum number of fraction digits. Must be between 0 and 20. - **maximum** (int?) - Optional - The maximum number of fraction digits. Must be between 0 and 20. ``` -------------------------------- ### Format a list of strings Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormat/format.html Demonstrates basic usage of the format method to concatenate a list of strings. ```dart import 'package:intl4x/list_format.dart'; void main() { print(ListFormat.format(['Dog', 'Cat'])); // Prints 'Dog and Cat' } ``` -------------------------------- ### Usage of toLowerCase Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMapping/toLowerCase.html Demonstrates how to initialize CaseMapping with a locale and convert a string to lowercase. ```dart import 'package:intl4x/case_mapping.dart'; void main() { final caseMapping = CaseMapping(locale: Locale('en', 'US')); print(caseMapping.toLowerCase('İ')); // Prints 'i̇' } ``` -------------------------------- ### Format time using DateTimeFormat Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/time.html Demonstrates basic usage of the time method to format a DateTime object into a string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.time().format(date)); // Output: '4:00 AM' } ``` -------------------------------- ### Formatting a month with DateTimeFormat Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/month.html Demonstrates basic usage of the month method to format a DateTime object into a month string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.month().format(date)); // Output: 'Dec' } ``` -------------------------------- ### Implementation of day static method Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/day.html Internal implementation details for the day static method. ```dart static DateTimeFormatter day({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).d(alignment: alignment, length: length); ``` -------------------------------- ### Initialize PluralRules Source: https://pub.dev/documentation/intl4x/latest/plural_rules/PluralRules/PluralRules.html Constructor implementation for creating a new PluralRules instance with specific locale and formatting options. ```dart PluralRules({ Locale? locale, PluralType type = PluralType.cardinal, Digits? digits, RoundingMode roundingMode = RoundingMode.halfExpand, int minimumIntegerDigits = 1, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, }) : _pluralRulesImpl = PluralRulesImpl.build( locale ?? findSystemLocale(), PluralRulesOptions( digits: digits, minimumIntegerDigits: minimumIntegerDigits, roundingMode: roundingMode, trailingZeroDisplay: trailingZeroDisplay, type: type, ), ); ``` -------------------------------- ### Locale withClockStyle(ClockStyle clockStyle) Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withClockStyle.html Returns a new Locale instance configured with the provided clock style. ```APIDOC ## Locale withClockStyle(ClockStyle clockStyle) ### Description Returns a new `Locale` instance with the specified `clockStyle` applied. ### Signature `Locale withClockStyle(ClockStyle clockStyle)` ### Parameters - **clockStyle** (ClockStyle) - Required - The clock style to be applied to the new Locale. ``` -------------------------------- ### Select PluralCategory for English Source: https://pub.dev/documentation/intl4x/latest/plural_rules/PluralRules/select.html Demonstrates selecting plural categories for singular and plural values in en-US locale. ```dart PluralRules(locale: Locale.parse('en-US')) .select(1) == PluralCategory.one PluralRules(locale: Locale.parse('en-US')) .select(2) == PluralCategory.other ``` -------------------------------- ### Initialize CaseMapping instance Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMapping/CaseMapping.html Constructs a new CaseMapping instance using the provided locale or the system default. ```dart CaseMapping({Locale? locale}) : _caseMappingImpl = CaseMappingImpl.build(locale ?? findSystemLocale()); ``` -------------------------------- ### Implementation of joinOr Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinOr.html Shows the underlying implementation of the joinOr method using ListFormat with ListType.or. ```dart String joinOr({Locale? locale}) => ListFormat(locale: locale, type: ListType.or).format(this); ``` -------------------------------- ### PluralRules constructor Source: https://pub.dev/documentation/intl4x/latest/plural_rules/PluralRules/PluralRules.html Initializes a new PluralRules instance with specific locale and formatting configurations. ```APIDOC ## PluralRules constructor ### Description Creates a new plural rules selector for determining plural forms based on cardinal or ordinal types. ### Parameters - **locale** (Locale?) - Optional - The locale defining the pluralization rules. Defaults to system locale if null. - **type** (PluralType) - Optional - Specifies if rules are for cardinal or ordinal numbers. Defaults to PluralType.cardinal. - **digits** (Digits?) - Optional - Configuration for number formatting. - **roundingMode** (RoundingMode) - Optional - Determines how numbers are rounded. Defaults to RoundingMode.halfExpand. - **minimumIntegerDigits** (int) - Optional - Minimum number of integer digits. Defaults to 1. - **trailingZeroDisplay** (TrailingZeroDisplay) - Optional - Configuration for displaying trailing zeros. Defaults to TrailingZeroDisplay.auto. ``` -------------------------------- ### Format DateTime with Time Zone Source: https://pub.dev/documentation/intl4x/latest/datetime_format/ZonedDateTimeFormatter-class.html Demonstrates how to use DateTimeFormat to create a formatter and apply it to a specific DateTime and time zone. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final timeZone = 'Europe/Paris'; final dateTime = DateTime.parse('2024-07-01T08:50:07'); final formatter = DateTimeFormat.yearMonthDayTime( locale: Locale.parse('en'), length: DateTimeLength.long, ).withTimeZoneShort(); print( formatter.format(dateTime, timeZone), ); // prints 'July 1, 2024 at 8:50:07
AM GMT+2' } ``` -------------------------------- ### Implementation of toLocaleUpperCase Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMappingExt/toLocaleUpperCase.html Shows the underlying implementation using the CaseMapping class. ```dart String toLocaleUpperCase(Locale locale) => CaseMapping(locale: locale).toUpperCase(this); ``` -------------------------------- ### StandardNotation() Source: https://pub.dev/documentation/intl4x/latest/number_format/StandardNotation-class.html Creates a new instance of the StandardNotation class. ```APIDOC ## StandardNotation() ### Description Creates a constant instance of the StandardNotation class. ``` -------------------------------- ### Format date and time using yearMonthDayTime Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/yearMonthDayTime.html Demonstrates basic usage of the yearMonthDayTime formatter to display a date and time string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.yearMonthDayTime().format(date)); // Output: 'Dec 17, 2021, 4:00 AM' } ``` -------------------------------- ### NumberFormat.compact Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.compact.html Creates a NumberFormat instance for compact number formatting. Note that this is currently not implemented on native platforms. ```APIDOC ## NumberFormat.compact ### Description Creates a NumberFormat instance for compact number formatting. Compact notation is a way to format numbers that are very large or very small in a more human-readable way, e.g., "1.2M" instead of "1,200,000". ### Signature NumberFormat.compact({Locale? locale, CompactDisplay compactDisplay = CompactDisplay.short, FormatStyle style = const DecimalStyle(), SignDisplay signDisplay = SignDisplay.auto, Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits}) ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. Defaults to the system locale. - **compactDisplay** (CompactDisplay) - Optional - The display style for compact notation. Defaults to CompactDisplay.short. - **style** (FormatStyle) - Optional - The overall formatting style. Defaults to DecimalStyle. - **signDisplay** (SignDisplay) - Optional - When to display the sign for the number. Defaults to SignDisplay.auto. - **useGrouping** (Grouping) - Optional - Whether to use grouping separators. Defaults to Grouping.auto. - **numberingSystem** (NumberingSystem?) - Optional - The numbering system to use (e.g., 'latn', 'arab'). - **roundingMode** (RoundingMode) - Optional - The rounding strategy to use. Defaults to RoundingMode.halfExpand. - **trailingZeroDisplay** (TrailingZeroDisplay) - Optional - When to display trailing zeros. Defaults to TrailingZeroDisplay.auto. - **minimumIntegerDigits** (int) - Optional - The minimum number of integer digits to use. Defaults to 1. - **digits** (Digits?) - Optional - Specifies the minimum and maximum number of fraction or significant digits. ``` -------------------------------- ### Implementation of toLocaleLowerCase Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMappingExt/toLocaleLowerCase.html Shows the underlying implementation of the toLocaleLowerCase method using the CaseMapping class. ```dart String toLocaleLowerCase(Locale locale) => CaseMapping(locale: locale).toLowerCase(this); ``` -------------------------------- ### StandardNotation() Source: https://pub.dev/documentation/intl4x/latest/number_format/StandardNotation/StandardNotation.html The constructor for the StandardNotation class, used to create a new instance for number formatting. ```APIDOC ## StandardNotation() ### Description Creates a new instance of the StandardNotation class. ### Signature `const StandardNotation()` ``` -------------------------------- ### Format Lists Source: https://pub.dev/documentation/intl4x/latest/index.html Join list items into grammatically correct strings based on locale rules. ```dart import 'package:intl4x/list_format.dart'; void main() { final list = ['apples', 'bananas', 'oranges']; final english = Locale.parse('en'); print(list.joinAnd(locale: english)); // "apples, bananas, and oranges" print(list.joinOr(locale: english)); // "apples, bananas, or oranges" } ``` -------------------------------- ### NumberFormat constructor Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.html Creates a NumberFormat instance with custom formatting options. ```APIDOC ## NumberFormat constructor ### Description Creates a NumberFormat instance with custom formatting options for localizing numbers. ### Signature NumberFormat({Locale? locale, FormatStyle style, String? currency, SignDisplay signDisplay, Notation notation, Grouping useGrouping, NumberingSystem? numberingSystem, RoundingMode roundingMode, TrailingZeroDisplay trailingZeroDisplay, int minimumIntegerDigits, Digits? digits}) ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. Defaults to the system locale. - **style** (FormatStyle) - Optional - The overall formatting style. Defaults to DecimalStyle. - **currency** (String?) - Optional - The 3-letter ISO 4217 currency code for currency formatting. - **signDisplay** (SignDisplay) - Optional - When to display the sign for the number. Defaults to SignDisplay.auto. - **notation** (Notation) - Optional - The notation system to use. Defaults to StandardNotation. - **useGrouping** (Grouping) - Optional - Whether to use grouping separators. Defaults to Grouping.auto. - **numberingSystem** (NumberingSystem?) - Optional - The numbering system to use (e.g., 'latn', 'arab'). - **roundingMode** (RoundingMode) - Optional - The rounding strategy to use. Defaults to RoundingMode.halfExpand. - **trailingZeroDisplay** (TrailingZeroDisplay) - Optional - When to display trailing zeros. Defaults to TrailingZeroDisplay.auto. - **minimumIntegerDigits** (int) - Optional - The minimum number of integer digits to use. Defaults to 1. - **digits** (Digits?) - Optional - Specifies the minimum and maximum number of fraction or significant digits. ``` -------------------------------- ### NumberFormat Constructor Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.html The internal implementation of the NumberFormat constructor, showing how options are passed to the underlying NumberFormatImpl. ```dart NumberFormat({ Locale? locale, FormatStyle style = const DecimalStyle(), String? currency, SignDisplay signDisplay = SignDisplay.auto, Notation notation = const StandardNotation(), Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits, }) : _impl = NumberFormatImpl.build( locale ?? findSystemLocale(), NumberFormatOptions.custom( currency: currency, digits: digits, minimumIntegerDigits: minimumIntegerDigits, notation: notation, numberingSystem: numberingSystem, roundingMode: roundingMode, signDisplay: signDisplay, style: style, trailingZeroDisplay: trailingZeroDisplay, useGrouping: useGrouping, ), ); ``` -------------------------------- ### FractionDigits(int? minimum, int? maximum) Source: https://pub.dev/documentation/intl4x/latest/number_format/FractionDigits-class.html Creates a new instance of FractionDigits to specify the range of fraction digits for number formatting. ```APIDOC ## FractionDigits(int? minimum, int? maximum) ### Description Creates a FractionDigits instance with optional minimum and maximum fraction digits to control number formatting precision. ### Parameters - **minimum** (int?) - Optional - The minimum number of fraction digits to use. - **maximum** (int?) - Optional - The maximum number of fraction digits to use. ``` -------------------------------- ### NumberFormat.percent Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.percent.html Creates a NumberFormat instance configured for percent formatting. Note: This is currently not implemented on native platforms. ```APIDOC ## NumberFormat.percent ### Description Creates a NumberFormat instance for percent formatting. ### Signature NumberFormat.percent({Locale? locale, SignDisplay signDisplay = SignDisplay.auto, Notation notation = const StandardNotation(), Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits}) ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. Defaults to the system locale. - **signDisplay** (SignDisplay) - Optional - When to display the sign for the number. Defaults to SignDisplay.auto. - **notation** (Notation) - Optional - The notation system to use. Defaults to StandardNotation. - **useGrouping** (Grouping) - Optional - Whether to use grouping separators. Defaults to Grouping.auto. - **numberingSystem** (NumberingSystem?) - Optional - The numbering system to use (e.g., 'latn', 'arab'). - **roundingMode** (RoundingMode) - Optional - The rounding strategy to use. Defaults to RoundingMode.halfExpand. - **trailingZeroDisplay** (TrailingZeroDisplay) - Optional - When to display trailing zeros. Defaults to TrailingZeroDisplay.auto. - **minimumIntegerDigits** (int) - Optional - The minimum number of integer digits to use. Defaults to 1. - **digits** (Digits?) - Optional - Specifies the minimum and maximum number of fraction or significant digits. ### Example ```dart import 'package:intl4x/number_format.dart'; void main() { print(NumberFormat.percent().format(0.5)); // Prints '50%' } ``` ``` -------------------------------- ### PercentStyle Constructor Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/PercentStyle/PercentStyle.html The constant constructor used to initialize a PercentStyle instance. ```dart const PercentStyle(); ``` -------------------------------- ### joinAnd({Locale? locale}) Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinAnd.html Joins a list of strings in a locale-dependent manner using 'and'-based grouping. ```APIDOC ## joinAnd ### Description Joins a list in a locale-dependent manner using 'and'-based grouping (e.g., 'A, B, and C'). ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting the list. ### Example ```dart import 'package:intl4x/list_format.dart'; void main() { print(['A', 'B', 'C'].joinAnd()); // Prints 'A, B, and C' } ``` ``` -------------------------------- ### joinAnd({Locale? locale}) Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x.html Joins a list of strings in a locale-dependent manner using 'and'-based grouping. ```APIDOC ## joinAnd({Locale? locale}) -> String ### Description Joins a list of strings in a locale-dependent manner using 'and'-based grouping. ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. If null, the default locale is used. ``` -------------------------------- ### Digits.withSignificantAndFractionDigits Source: https://pub.dev/documentation/intl4x/latest/number_format/Digits/Digits.withSignificantAndFractionDigits.html Constructor to initialize Digits with specific significant and fraction digit constraints. ```APIDOC ## Digits.withSignificantAndFractionDigits ### Description Creates a configuration object for number formatting that specifies both significant and fraction digit ranges. ### Parameters - **minimumSignificantDigits** (int?) - Optional - The minimum number of significant digits to display. Defaults to 1. - **maximumSignificantDigits** (int?) - Optional - The maximum number of significant digits to display. Defaults to 21. - **minimumFractionDigits** (int?) - Optional - The minimum number of fraction digits to display. - **maximumFractionDigits** (int?) - Optional - The maximum number of fraction digits to display. - **roundingPriority** (RoundingPriority?) - Optional - The priority strategy for rounding. Defaults to RoundingPriority.auto. ``` -------------------------------- ### Implementation of time static method Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/time.html The internal implementation of the time method using DateTimeFormatImpl to build the formatter. ```dart static DateTimeFormatter time({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).t(alignment: alignment, length: length, timePrecision: timePrecision); ``` -------------------------------- ### Select PluralCategory for Polish Source: https://pub.dev/documentation/intl4x/latest/plural_rules/PluralRules/select.html Demonstrates selecting a 'few' plural category for the Polish language. ```dart PluralRules(locale: Locale.parse('pl')).select(3) == PluralCategory.few ``` -------------------------------- ### CaseMapping(Locale? locale) Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMapping-class.html Constructs a new CaseMapping instance configured for a specific locale. ```APIDOC ## Constructor: CaseMapping ### Description Creates a new instance of the CaseMapping class. The provided locale determines the rules for case transformation. ### Parameters - **locale** (Locale?) - Optional - The locale to use for case mapping operations. ``` -------------------------------- ### Usage of toLocaleLowerCase Source: https://pub.dev/documentation/intl4x/latest/case_mapping/CaseMappingExt/toLocaleLowerCase.html Demonstrates converting a character to lowercase using a specific locale. ```dart import 'package:intl4x/case_mapping.dart'; void main() { print('İ'.toLocaleLowerCase(Locale('en', 'US'))); // Prints 'i̇' } ``` -------------------------------- ### FractionDigits Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/FractionDigits/FractionDigits.html The constructor enforces that fraction digits are within the 0-20 range and that the minimum does not exceed the maximum. ```dart const FractionDigits({this.minimum, this.maximum}) : assert(minimum != null ? 0 <= minimum && minimum <= 20 : true), assert(minimum != null && maximum != null ? minimum <= maximum : true); ``` -------------------------------- ### NumberFormat.percent implementation details Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.percent.html Internal implementation of the NumberFormat.percent constructor using NumberFormatImpl.build. ```dart //TODO: Implement in ICU4X NumberFormat.percent({ Locale? locale, SignDisplay signDisplay = SignDisplay.auto, Notation notation = const StandardNotation(), Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits, }) : _impl = NumberFormatImpl.build( locale ?? findSystemLocale(), NumberFormatOptions.percent( digits: digits, minimumIntegerDigits: minimumIntegerDigits, numberingSystem: numberingSystem, roundingMode: roundingMode, signDisplay: signDisplay, trailingZeroDisplay: trailingZeroDisplay, useGrouping: useGrouping, notation: notation, ), ); ``` -------------------------------- ### joinUnit(Locale? locale) Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x/joinUnit.html Joins a list of elements into a single string using unit-based grouping, optionally specifying a locale. ```APIDOC ## joinUnit ### Description Joins a list in a locale-dependent manner using unit-based grouping. This method is an extension on List. ### Signature `String joinUnit({Locale? locale})` ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. If not provided, the default locale is used. ### Example ```dart import 'package:intl4x/list_format.dart'; void main() { print(['A', 'B', 'C'].joinUnit()); // Prints 'A, B, C' } ``` ``` -------------------------------- ### Implementation of yearMonthDay Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/yearMonthDay.html The internal implementation of the yearMonthDay static method. ```dart static DateTimeFormatter yearMonthDay({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, YearStyle? yearStyle, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).ymd(alignment: alignment, length: length, yearStyle: yearStyle); ``` -------------------------------- ### Locale.system Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/system.html Retrieves the current system locale. ```APIDOC ## Locale.system ### Description Returns the system's current locale. ### Signature `static Locale get system` ### Implementation `static Locale get system => findSystemLocale();` ``` -------------------------------- ### Locale.withCalendar(Calendar calendar) Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withCalendar.html Returns a new Locale instance configured with the provided calendar. ```APIDOC ## Locale.withCalendar ### Description Returns a new `Locale` instance with the specified `calendar` applied. ### Signature `Locale withCalendar(Calendar calendar)` ### Parameters - **calendar** (Calendar) - Required - The calendar system to be associated with the new Locale. ``` -------------------------------- ### Locale withNumberingSystem Implementation Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/withNumberingSystem.html Defines the abstract method signature for setting the numbering system on a Locale object. ```dart Locale withNumberingSystem(NumberingSystem system); ``` -------------------------------- ### Implementation of the month static method Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/month.html Internal implementation details for the month static method using DateTimeFormatImpl. ```dart static DateTimeFormatterStandalone month({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).m(alignment: alignment, length: length); ``` -------------------------------- ### NumberFormat.currency Implementation Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat/NumberFormat.currency.html The internal implementation of the NumberFormat.currency constructor, showing the mapping of parameters to NumberFormatOptions. ```dart NumberFormat.currency({ Locale? locale, required String currency, CurrencyDisplay currencyDisplay = CurrencyDisplay.symbol, CurrencySign currencySign = CurrencySign.standard, //General options SignDisplay signDisplay = SignDisplay.auto, Notation notation = const StandardNotation(), Grouping useGrouping = Grouping.auto, NumberingSystem? numberingSystem, RoundingMode roundingMode = RoundingMode.halfExpand, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto, int minimumIntegerDigits = 1, Digits? digits, }) : _impl = NumberFormatImpl.build( locale ?? findSystemLocale(), NumberFormatOptions.currency( currency: currency, currencyDisplay: currencyDisplay, currencySign: currencySign, digits: digits, minimumIntegerDigits: minimumIntegerDigits, notation: notation, numberingSystem: numberingSystem, roundingMode: roundingMode, signDisplay: signDisplay, trailingZeroDisplay: trailingZeroDisplay, useGrouping: useGrouping, ), ); ``` -------------------------------- ### Implement toLanguageTag abstract method Source: https://pub.dev/documentation/intl4x/latest/plural_rules/Locale/toLanguageTag.html Defines the signature for the toLanguageTag method with an optional separator parameter. ```dart String toLanguageTag([String separator = '-']); ``` -------------------------------- ### NumberFormat Constructors Source: https://pub.dev/documentation/intl4x/latest/number_format/NumberFormat-class.html The NumberFormat class provides several constructors to initialize formatting instances for different use cases. ```APIDOC ## NumberFormat Constructors ### NumberFormat(...) Creates a standard NumberFormat instance with custom formatting options. ### NumberFormat.compact(...) Creates a NumberFormat instance specifically for compact number formatting. ### NumberFormat.currency(...) Creates a NumberFormat instance for currency formatting, requiring a currency code. ### NumberFormat.percent(...) Creates a NumberFormat instance for percent formatting. ``` -------------------------------- ### PluralRules(Constructor) Source: https://pub.dev/documentation/intl4x/latest/plural_rules/PluralRules-class.html Creates a new instance of the PluralRules selector with specified locale, type, and formatting options. ```APIDOC ## PluralRules({Locale? locale, PluralType type = PluralType.cardinal, Digits? digits, RoundingMode roundingMode = RoundingMode.halfExpand, int minimumIntegerDigits = 1, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto}) ### Description Creates a new plural rules selector instance configured for a specific locale and plural type. ### Parameters - **locale** (Locale?) - Optional - The locale to use for plural rules. - **type** (PluralType) - Optional - The type of pluralization (default: PluralType.cardinal). - **digits** (Digits?) - Optional - Configuration for digit formatting. - **roundingMode** (RoundingMode) - Optional - The rounding mode to apply (default: RoundingMode.halfExpand). - **minimumIntegerDigits** (int) - Optional - The minimum number of integer digits (default: 1). - **trailingZeroDisplay** (TrailingZeroDisplay) - Optional - Configuration for trailing zero display (default: TrailingZeroDisplay.auto). ``` -------------------------------- ### joinUnit({Locale? locale}) Source: https://pub.dev/documentation/intl4x/latest/list_format/ListFormatIntl4x.html Joins a list of strings in a locale-dependent manner using unit-based grouping. ```APIDOC ## joinUnit({Locale? locale}) -> String ### Description Joins a list of strings in a locale-dependent manner using unit-based grouping. ### Parameters - **locale** (Locale?) - Optional - The locale to use for formatting. If null, the default locale is used. ``` -------------------------------- ### Digits.withFractionDigits Source: https://pub.dev/documentation/intl4x/latest/number_format/Digits/Digits.withFractionDigits.html Constructor for configuring fraction digit settings in number formatting. ```APIDOC ## Digits.withFractionDigits ### Description Creates a configuration for number formatting that specifies the number of fraction digits to display. ### Parameters - **minimum** (int?) - Optional - The minimum number of fraction digits. - **maximum** (int?) - Optional - The maximum number of fraction digits. - **roundingIncrement** (int?) - Optional - The increment used for rounding the fraction digits. ``` -------------------------------- ### Implementation of monthDay Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/monthDay.html The internal implementation of the monthDay static method using DateTimeFormatImpl. ```dart static DateTimeFormatter monthDay({ Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, }) => DateTimeFormatImpl.build( locale ?? findSystemLocale(), ).md(alignment: alignment, length: length); ``` -------------------------------- ### Format year using DateTimeFormat Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/year.html Demonstrates basic usage of the year method to format a DateTime object into a string representing the year. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.year().format(date)); // Output: '2021' } ``` -------------------------------- ### Digits.withSignificantDigits Source: https://pub.dev/documentation/intl4x/latest/number_format/Digits/Digits.withSignificantDigits.html Constructor to create a Digits configuration with significant digit constraints. ```APIDOC ## Digits.withSignificantDigits ### Description Creates a configuration for number formatting that enforces a specific range of significant digits. ### Parameters - **minimum** (int?) - Optional - The minimum number of significant digits. Defaults to 1. - **maximum** (int?) - Optional - The maximum number of significant digits. Defaults to 21. ``` -------------------------------- ### Format date with yearMonthDayWeekdayTime Source: https://pub.dev/documentation/intl4x/latest/datetime_format/DateTimeFormat/yearMonthDayWeekdayTime.html Demonstrates basic usage of the yearMonthDayWeekdayTime formatter to output a formatted date string. ```dart import 'package:intl4x/datetime_format.dart'; void main() { final date = DateTime(2021, 12, 17, 4, 0, 42); print(DateTimeFormat.yearMonthDayWeekdayTime().format(date)); // Output: 'Fri, Dec 17, 2021, 4:00 AM' } ```