2021/5/28 : Flutter : Use a custom fontの訳

 

注意:基本的に下記説明の通りにやればフォントは変わるんですが、一つだけ、pubspec.yamlファイルの設定はホットリロードでは反映されないので、試す場合「プログラム停止→再実行」が必要です

それを知らないと「何回ホットリロードしても全くフォントが変わらない」あるいは「変わったり変わらなかったりする」ということになるので注意してください笑


Use a custom font

Although Android and iOS offer high quality system fonts, one of the most common requests from designers is for custom fonts. For example, you might have a custom-built font from a …

2021/5/21 : Flutter : Extract Flutter Widgetを使おう

null-safety-article

 

(1)まずシンプルな例から。

//(1)Extract前(簡単バージョン)
import 'package:flutter/material.dart';
void main(){
  runApp(MaterialApp(home:MyApp(),),);
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar:AppBar(title:const Text('title'),),
      body: Container(
        color:Colors.green,
        child:Column(
          children:const [
            Card(
              child:Text("first card"),
            ),
            Card(
              child:Text("second card"),
            ),
          ],
        ),
      

2021/5/21 : Flutter : PopupMenuButtonと列挙型(enum)を使ってみよう。

null safety article

 

APIドキュメント

https://api.flutter.dev/flutter/material/PopupMenuButton-class.html


サンプル

ページ遷移(サンプル1)

//PopupMenuButtonのサンプル1(ページ遷移)

import 'package:flutter/material.dart';

void main() => runApp(
  MaterialApp(
    home: MyApp(),
  ),
);

void pushPage(BuildContext context, Widget page) {
  Navigator.of(context).push(
    MaterialPageRoute<void>(builder: (_) => page),
  );
}

List<Function> listOfRoute = [
      (BuildContext context) => 

2021/5/4 : Flutter : Internationalizing Flutter appsの訳パート1

Internationalizing Flutter apps

学ぶこと

  • How to track the device’s locale (the user’s preferred language).
  • デバイスのロケール(ユーザーの優先言語)を追跡する方法。
  • How to manage locale-specific app values.
  • ロケール固有のアプリ値を管理する方法。
  • How to define the locales an app supports.
  • アプリがサポートするロケールを定義する方法。

If your app might be deployed to users who …