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) =>