content: import 'package:flutter/material.dart';
  
  void main() => runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    @override
    _MyHomePageState createState() => _MyHomePageState();
  }
  
  class _MyHomePageState extends State<MyHomePage> {
    String _value = '';
  
    Future _select() async {
      var selected = await showTimePicker(
        initialTime: TimeOfDay.now(),
        context: context,
        // builderプロパティでカスタマイズできる
        // この場合はボタン位置を左寄せにしている
        builder: (BuildContext context, Widget child) {
          return Directionality(
            textDirection: TextDirection.rtl,
            child: child,
          );
        },
      );
      if (selected != null) {
        setState(() => _value = selected.toString());
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: const Text('showTimePicker'),
        ),
        body: Padding(
          padding: const EdgeInsets.all(32.0),
          child: Center(
            child: Column(
              children: <Widget>[
                Text(_value),
                RaisedButton(
                  onPressed: _select,
                  child: const Text('開く'),
                )
              ],
            ),
          ),
        ),
      );
    }
  }
  