Skip to content

Instantly share code, notes, and snippets.

View hyochan's full-sized avatar
🎯
Focusing

Hyo hyochan

🎯
Focusing
View GitHub Profile
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class Localization {
Localization(this._locale);
final Locale _locale;
@hyochan
hyochan / gist:eb3746bd40f89de8c16ef586bd792d99
Last active April 15, 2020 16:35
flutter_localized_example/main.dart
import 'package:flutter/material.dart';
import 'package:flutter\_localizations/flutter\_localizations.dart';
import './screens/splash.dart' show Splash;
import './screens/intro.dart' show Intro;
import './utils/localization.dart';
import './utils/theme.dart' as Theme;
void main() => runApp(new MyApp());
@hyochan
hyochan / gist:3ca8d354e3ff09b2e2348c6fcfcd517e
Last active April 15, 2020 16:34
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(
@hyochan
hyochan / gist:9aa7ede3af173ed536158f97d970031b
Last active April 15, 2020 16:34
localized_widget_test_legacy.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:localized_app_example/widgets/my_widget.dart' show MyWidget;
Widget makeTestableWidget({ Widget child }) {
return MediaQuery(
data: MediaQueryData(),
child: MaterialApp(
localizationsDelegates: [
@hyochan
hyochan / gist:7dce34518339f7935697484a68092072
Last active April 15, 2020 16:34
flutter_localized_example/localization.dart
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class Localization {
Localization(this._locale, {
this.isTest = false,
});
@hyochan
hyochan / gist:642cdff6e5bac0027723604df6f9ee9e
Last active April 15, 2020 16:33
flutter_localized_example/test/widget_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:localized_app_example/widgets/my_widget.dart' show MyWidget;
Widget makeTestableWidget({ Widget child }) {
return MediaQuery(
data: MediaQueryData(),
child: MaterialApp(
localizationsDelegates: [
{
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"javascript.validate.enable": false,
"window.zoomLevel": 1,
"typescript.updateImportsOnFileMove.enabled": "never",
"editor.fontSize": 13,
"editor.suggestSelection": "first",
"diffEditor.ignoreTrimWhitespace": false,
"terminal.integrated.shell.osx": "/bin/zsh",
@hyochan
hyochan / .vimrc
Last active September 9, 2020 04:07
filetype plugin indent on
syntax on
set guicursor=
set nohlsearch
set hidden
set noerrorbells
set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
set smartindent
set nu
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/dooboolab/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

Individual Contributor License Agreement Adapted from http://www.apache.org/licenses/icla.txt © The Apache Software Foundation

Thank you for your interest in dooboolab (the "Community"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Community must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Community and its users; it does not change your rights to use your own Contributions for any other purpose.

Full name: FULL NAME Mailing Address: ADDRESS Country: COUNTRY Telephone: TELEPHONE E-Mail: EMAIL