11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FlutterでAndroidの日本語フォントが正しく表示されない対応 (1.0.0)

Posted at

以下の情報を元に試してみましたが、1.0.0では、日本語フォントが中華フォントになる問題は解決しませんでした。

解決策

多言語化のライブラリ flutter_localizations を空で仕込んどくと解決できました。

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations: <- 追加
    sdk: flutter

main.dart

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // Delegate には、flutter_localizations 標準のものだけを設定
      localizationsDelegates: [ 
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: [
        Locale('ja', ''), // Japanese
      ],
      home: MyHomePage(title: '今骨累直'),
    );
  }
}

検証環境

$ flutter --version
Flutter 1.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5391447fae (6 weeks ago) • 2018-11-29 19:41:26 -0800
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

以上

11
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?