Migration to Flutter Guide
Discover our battle-tested 21-step framework for a smooth and successful migration to Flutter!
Home
Glossary

Intl package in Flutter

What is the intl package in Flutter?

The intl package in Flutter app development provides tools for internationalization and localization, commonly referred to as i18n and l10n.

It allows applications to format dates, numbers, currencies, and messages according to a selected locale. In Flutter projects, intl is typically used as a foundational layer for handling localized content and locale-aware formatting.

Key characteristics of the intl package

The intl package provides several core capabilities:

  • locale-aware formatting utilities,
  • support for plural and gender rules,
  • integration with Flutter's localization infrastructure,
  • compatibility with generated localization files.

Intl acts as a low-level building block rather than a complete localization solution on its own.

Why does Intl matter in Flutter app development?

Intl matters because applications often target users in multiple regions.

Locale-aware formatting ensures that dates, numbers, and currencies appear familiar and correct to users. Without proper internationalization, even well-designed applications can feel inconsistent or incorrect outside the default locale.

How does the intl package work?

The intl package works by using locale information to control how values are formatted and displayed.

Based on the active locale, intl applies appropriate rules for:

  • date and time formatting,
  • number and currency formatting,
  • pluralization and gender-aware messages.

In Flutter, intl is usually integrated with the framework's localization system, which provides the current locale and triggers UI updates when it changes.

Example of intl

This simple example shows how locale-aware formatting works in practice:

import 'package:intl/intl.dart';

void main() {
  final dateFormatter = DateFormat.yMMMMd('es_ES');
  final currencyFormatter = NumberFormat.currency(
    locale: 'es_ES',
    symbol: '€',
  );

  print(DateTime(2026, 1, 15).format(date)); // 15 de enero de 2026
  print(currencyFormatter.format(12345.67)); // 12.345,67 €
}

In this example:

  • DateFormat formats the date according to Spanish locale rules.
  • NumberFormat.currency applies correct separators and currency symbol.
  • The locale fully controls formatting without manual adjustments.

This demonstrates the core value of intl: correct, locale-aware formatting with minimal code.

When to use the intl package?

The intl package is essential whenever an application needs to handle content for multiple locales or regions. This includes formatting dates, times, numbers, and currencies according to the conventions of the user's locale. For example, the date "12/02/2026" might be interpreted differently in the US and Europe, and monetary values like "$1,000.50" require correct placement of separators and currency symbols.

Intl also provides tools for handling pluralization, gender-specific text, and other language rules that vary between locales. This is important for creating natural, grammatically correct messages, such as "1 item in your cart" versus "5 items in your cart." When building production apps for international audiences, or any app where the presentation of locale-sensitive data affects usability or user trust, intl ensures consistency and correctness across the app.

When not to use the Intl package?

Intl may not be necessary for applications with a single, fixed locale or where user-facing text is static and never changes. In these cases, introducing the package can add unnecessary dependency overhead, increase bundle size, and complicate build configuration.

Similarly, apps that are prototypes, internal tools, or MVPs targeting a narrow audience often do not benefit from full localization support. If localization is explicitly out of scope, simpler string handling and hardcoded formats may suffice. Adding intl in such scenarios may introduce complexity without tangible benefits, so it's better to avoid it until internationalization becomes a real requirement.

Common mistakes to avoid

Common mistakes when using intl include:

  • Formatting values manually instead of using intl utilities.
  • Mixing localized and hardcoded user-facing strings.
  • Assuming pluralization rules are identical across languages.

These issues usually surface when additional locales are introduced later.

Best practices for intl

When working with intl, it is recommended to:

  • Centralize all localized strings.
  • Avoid hardcoded user-facing text.
  • Rely on intl formatting utilities instead of custom logic.
  • Test the app with multiple locales early.

Following these practices makes localization predictable and easier to maintain.

Learn more

Flutter AI localization

How to Speed Up Flutter App Localization With AI

Many projects still grapple with time-consuming processes, such as utilizing ARB files for translations. Addressing this gap, at LeanCode, we created the Flutter arb_translation package, automating the addition of missing translations with Google's Gemini AI or OpenAI's ChatGPT, promising streamlined localization for Flutter apps. Read how it works.

RTL in Flutter by LeanCode

Right to Left (RTL) in Flutter App - Developer's Guide

Find the most important things to keep in mind when introducing RTL design in your Flutter mobile app and how you can use Flutter to support various text directions with little effort. Follow the guide on RTL prepared by Flutter Developer.