flappy_translator 2.0.0-nullsafety.3 flappy_translator: ^2.0.0-nullsafety.3 copied to clipboard
A tool which automatically generates Flutter localization resources from CSV and Excel files.
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'i18n.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
localizationsDelegates: [
const I18nDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: I18nDelegate.supportedLocals,
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('flappy_translator'),
),
body: Center(
child: Column(
children: <Widget>[
Text(I18n.of(context).plainText),
Text(I18n.of(context).welcome(name: 'Dash')),
Text(I18n.of(context).favoriteColor),
],
),
),
);
}
}