flutter_i18n 0.13.1 flutter_i18n: ^0.13.1 copied to clipboard
i18n made easy for Flutter. With flutter_i18n you can make your app international, using just a simple .json file!
import 'dart:async';
import 'package:flutter/material.dart';
import 'basic_example.dart' as basicExample;
import 'namespace_example.dart' as namespaceExample;
import 'network_example.dart' as networkExample;
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.green,
),
home: Scaffold(
appBar: AppBar(title: Text("Flutter i18n")),
body: Builder(builder: (BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: () {
basicExample.main();
},
child: Text("Run `basic` example"),
),
RaisedButton(
onPressed: () {
networkExample.main();
},
child: Text("Run `network` example"),
),
RaisedButton(
onPressed: () {
namespaceExample.main();
},
child: Text("Run `namespace` example"),
),
],
));
})));
}
}