content: import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  
  void main() => runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return CupertinoApp(
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    @override
    State<StatefulWidget> createState() {
      return _MyHomePageState();
    }
  }
  
  class _MyHomePageState extends State<MyHomePage> {
    int lastSelectedValue = 0;
  
    @override
    Widget build(BuildContext context) {
      return CupertinoPageScaffold(
        navigationBar: const CupertinoNavigationBar(
          middle: Text('CupertinoPicker'),
        ),
        child: Center(
          child: CupertinoButton(
            onPressed: () {
              showCupertinoModalPopup<String>(
                context: context,
                builder: (BuildContext context) {
                  return _buildBottomPicker(CupertinoPicker(
                    onSelectedItemChanged: (value) {
                      setState(() {
                        lastSelectedValue = value;
                      });
                    },
                    itemExtent: 32.0,
                    children: const [
                      Text("選択肢1"),
                      Text("選択肢2"),
                      Text("選択肢3"),
                      Text("選択肢4"),
                      Text("選択肢5"),
                    ],
                  ));
                },
              );
            },
            child: const Text('開く'),
          ),
        ),
      );
    }
  
    Widget _buildBottomPicker(Widget picker) {
      return Container(
        height: 216,
        padding: const EdgeInsets.only(top: 6.0),
        color: CupertinoColors.white,
        child: DefaultTextStyle(
          style: const TextStyle(
            color: CupertinoColors.black,
            fontSize: 22.0,
          ),
          child: GestureDetector(
            onTap: () {},
            child: SafeArea(
              top: false,
              child: picker,
            ),
          ),
        ),
      );
    }
  }
  