Skip to content

Instantly share code, notes, and snippets.

@hyochan
Last active April 15, 2020 16:34
Show Gist options
  • Save hyochan/3ca8d354e3ff09b2e2348c6fcfcd517e to your computer and use it in GitHub Desktop.
Save hyochan/3ca8d354e3ff09b2e2348c6fcfcd517e to your computer and use it in GitHub Desktop.
flutter_localized_example/my_widget.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../utils/localization.dart' show Localization;
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
var localization = Localization.of(context);
return Scaffold(
primary: true,
body: Container(
child: Center(
child: Text(
localization.trans('LOADING'),
style: TextStyle(
fontSize: 36.0,
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment