This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// marvel_comic.g.dart | |
... | |
_$_MarvelComic _$$_MarvelComicFromJson(Map<String, dynamic> json) => | |
_$_MarvelComic( | |
... | |
format: $enumDecodeNullable(_$MarvelComicFormatEnumMap, json['format'], | |
unknownValue: MarvelComicFormat.unknown) ?? | |
MarvelComicFormat.unknown, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleLocalizations</key> | |
<array> | |
<string>en</string> | |
<string>fr</string> | |
<string>uk</string> | |
</array> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyHomePage extends StatefulWidget { | |
const MyHomePage({Key? key}) : super(key: key); | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
int _counter = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) => MaterialApp( | |
localizationsDelegates: [ | |
ExampleLocalizations.delegate, | |
GlobalMaterialLocalizations.delegate, | |
GlobalWidgetsLocalizations.delegate, | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _supportedLocales = ['en', 'fr', 'uk']; | |
class ExampleLocalizations { | |
const ExampleLocalizations(this.translations); | |
final Translations translations; | |
static final _translations = <String, Translations Function()>{ | |
'en': () => const Translations(), | |
'fr': () => const Translations_fr(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
homePageTitle: Exemple de localisation en Flutter | |
homePageCenterText(int times): "Vous avez appuyé le bouton $times fois" | |
incrementTooltip: Incrémenter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
homePageTitle: Flutter localization example | |
homePageCenterText(int times): | |
"You have pushed the button $times ${_plural(times, one:'time', many:'times')}" | |
incrementTooltip: Increment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
flutter: | |
sdk: flutter | |
flutter_localizations: | |
sdk: flutter | |
i69n: ^2.0.1 | |
dev_dependencies: | |
flutter_test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Translations_fr extends Translations { | |
const Translations_fr(); | |
String get greetings => "Bonjour le monde!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Translations implements i69n.I69nMessageBundle { | |
const Translations(); | |
String get greetings => "Hello, world!"; | |
} |
NewerOlder