flutter_i18n 0.36.0 copy "flutter_i18n: ^0.36.0" to clipboard
flutter_i18n: ^0.36.0 copied to clipboard

i18n made easy for Flutter. With flutter_i18n you can make your app international, using just a simple .json, .xml, .yaml or .toml file!

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:logging/logging.dart';

import 'basic_example.dart' as basicExample;
import 'local_example.dart' as localeExample;
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) {
    Logger.root.onRecord.listen((record) {
      print(record);
    });
    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>[
                  ElevatedButton(
                    key: Key('basicExample'),
                    onPressed: () {
                      basicExample.main();
                    },
                    child: Text("Run `basic` example"),
                  ),
                  ElevatedButton(
                    key: Key('networkExample'),
                    onPressed: () {
                      networkExample.main();
                    },
                    child: Text("Run `network` example"),
                  ),
                  ElevatedButton(
                    key: Key('nameSpaceExample'),
                    onPressed: () {
                      namespaceExample.main();
                    },
                    child: Text("Run `namespace` example"),
                  ),
                  ElevatedButton(
                    key: Key('localeExample'),
                    onPressed: () {
                      localeExample.main();
                    },
                    child: Text("Run `locale` example"),
                  )
                ],
              ));
            })));
  }
}
197
likes
0
pub points
97%
popularity

Publisher

unverified uploader

i18n made easy for Flutter. With flutter_i18n you can make your app international, using just a simple .json, .xml, .yaml or .toml file!

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_localizations, flutter_web_plugins, http, intl, logging, path, toml, xml2json, yaml

More

Packages that depend on flutter_i18n