-
Book Overview & Buying
-
Table Of Contents
Dart By Example
By :
The intl package provides functionality for internationalization and localization of Dart applications. This not only includes the important aspect of translating interface text into other languages but also includes the formatting of text (not every language is formatted from left to right), dates and numbers.
The interface of an application largely consists of buttons, with a few other labels and controls. A phrasebook of the application's interface language can be created using Intl.message and stored as static functions in the PhraseBook class, which can be found in the interfacetrans.dart file. This organizes all the strings that are to be set on the interface elements at runtime using the value or text properties:
class PhraseBook {
// Navigation controls.
static String btnFirstSlide() => Intl.message("First",
name: "btnFirstSlide", desc: "Button label - go to the first slide.");...
Change the font size
Change margin width
Change background colour