リスト 4.35


//flutter
import 'package:flutter/material.dart';

void main() {
  return runApp(TestPage());
}

//リスト4.35
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Drawer',
      home: Scaffold(
        appBar: AppBar(title: Text('Drawer')),
        body: Center(child: Text('Drawer')),
        drawer: Drawer(
          child: ListView(
            children: <Widget>[
              DrawerHeader(
                decoration: BoxDecoration(
                  color: Colors.blue,
                ),
                child: Center(
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Icon(Icons.flutter_dash, size: 100),
                      Text('Drawer')
                    ]
                  )
                ),
              ),
              ListTile(
                title: Text('ライセンス'),
                trailing: Icon(Icons.keyboard_arrow_right),
                onTap: () {},
              ),
              ListTile(
                title: Text('利用規約'),
                trailing: Icon(Icons.keyboard_arrow_right),
                onTap: () {}
              )
            ],
          ),
        )
      )
    );
  }
}