Skip to content

Instantly share code, notes, and snippets.

@plateaukao
Created August 16, 2020 03:28
Show Gist options
  • Save plateaukao/ad59f2862b72b7948ded63fa9e10d141 to your computer and use it in GitHub Desktop.
Save plateaukao/ad59f2862b72b7948ded63fa9e10d141 to your computer and use it in GitHub Desktop.
dart example with AppLocalizations
import 'package:flutter/material.dart';
import 'package:l10n_demo/l10n/app_localizations.dart'; // Add this line.
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
// Add the `localizationsDelegate` and `supportedLocales` lines.
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment