Skip to content

Instantly share code, notes, and snippets.

@Jonathanlight
Last active April 5, 2019 15:05
Show Gist options
  • Save Jonathanlight/8ad5f9786f685ca931d1458e1af22882 to your computer and use it in GitHub Desktop.
Save Jonathanlight/8ad5f9786f685ca931d1458e1af22882 to your computer and use it in GitHub Desktop.
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter I18n',
debugShowCheckedModeBanner: false,
theme: new ThemeData(
primarySwatch: Colors.green,
),
home: new MyHomePage(),
localizationsDelegates: [
FlutterI18nDelegate(
useCountryCode: false, fallbackFile: 'fr', path: 'assets/i18n'),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
);
}
}
class MyHomePage extends StatefulWidget {
@override
MyHomeState createState() => new MyHomeState();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment