{"id":753,"date":"2020-05-03T11:56:54","date_gmt":"2020-05-03T02:56:54","guid":{"rendered":"https:\/\/www.typea.info\/blog\/?p=753"},"modified":"2020-10-31T00:55:53","modified_gmt":"2020-10-30T15:55:53","slug":"flutter-popupmenu_android_iphone","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2020\/05\/03\/flutter-popupmenu_android_iphone\/","title":{"rendered":"Flutter : PopupMenu\u304b\u3089\u753b\u9762\u9077\u79fb\u3002Android\u3068iPhone"},"content":{"rendered":"<p><a href=\"https:\/\/www.amazon.co.jp\/%E5%9F%BA%E7%A4%8E%E3%81%8B%E3%82%89%E5%AD%A6%E3%81%B6-Flutter-%E7%9F%B3%E4%BA%95%E5%B9%B8%E6%AC%A1-ebook\/dp\/B082XQ81FH\/ref=as_li_ss_il?__mk_ja_JP=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A&amp;dchild=1&amp;keywords=flutter&amp;qid=1588473669&amp;sr=8-1&amp;linkCode=li2&amp;tag=typea09-22&amp;linkId=d0959f90591801c8eabd0049c8dfc84a&amp;language=ja_JP\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=B082XQ81FH&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22&amp;language=ja_JP\" border=\"0\"><\/a><\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/category\/flutter\/\">Flutter\u3067\u30a2\u30d7\u30ea\u958b\u767a\u306e\u305f\u3081\u306e\u90e8\u54c1\u3042\u3064\u3081<\/a>\u3002<\/p>\n<p>Popup\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u306e\u753b\u9762\u9077\u79fb\u3092\u8a66\u3059\u3002<img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px !important; border: currentcolor !important; border-image: none !important;\" src=\"https:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;language=ja_JP&amp;l=li2&amp;o=9&amp;a=B082XQ81FH\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/DoXB6XPpkGA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/flutter_popupmenu.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"flutter_popupmenu\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/flutter_popupmenu_thumb.png\" alt=\"flutter_popupmenu\" width=\"195\" height=\"344\" border=\"0\"><\/a><\/p>\n<ul>\n<li>\u4ee5\u4e0b\u306eimport\u306f\u9077\u79fb\u5148\u753b\u9762\n<ul>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2020\/05\/03\/flutter-google-sign-in-android-ios\/\">.\/google_sign_in.dart Google \u30b5\u30a4\u30f3\u30a4\u30f3\u3092\u8a66\u3059\u753b\u9762<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2020\/04\/28\/flutter_android_iphone_image_cropper\/\">.\/firestore_cloud_vision.dart Firestore\u3068Cloud Vision API\u3092\u8a66\u3059\u753b\u9762<\/a><\/li>\n<\/ul>\n<\/li>\n<li>ListTile \u3092\u4f7f\u3063\u3066\u3001\u30a2\u30a4\u30b3\u30f3\u3068\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a<\/li>\n<li>Icon <a href=\"https:\/\/api.flutter.dev\/flutter\/material\/Icons-class.html\">https:\/\/api.flutter.dev\/flutter\/material\/Icons-class.html<\/a><\/li>\n<\/ul>\n<h3>lib\/main.dart<\/h3>\n<pre class=\"prettyprint\">import 'dart:io';\nimport 'package:flutter\/cupertino.dart';\nimport 'package:flutter\/material.dart';\n\nimport '.\/google_sign_in.dart';\nimport '.\/firestore_cloud_vision.dart';\n\nvoid main() =&gt; runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  final message = \"Initial Message.\";\n  @override\n  Widget build(BuildContext context) {\n    return new MaterialApp(\n      title: 'Flutter Sample',\n      home: MyHomePage(message:this.message),\n    );\n  }\n}\n\nenum Menu { google_sign_in, firestore_cloud_vision }\nclass MyHomePageState extends State&lt;MyHomePage&gt;{\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(widget.message)\n      ),\n      body: PopupMenuButton(\n        onSelected: popupMenuSelected,\n        itemBuilder: (BuildContext context) =&gt;\n        &lt;PopupMenuEntry&lt;Menu&gt;&gt;[\n          const PopupMenuItem( child: const ListTile( leading:Icon(Icons.supervisor_account),\n              title:Text(\"Google Sign In\")), value: Menu.google_sign_in),\n          const PopupMenuItem( child: const ListTile( leading:Icon(Icons.crop_original),\n              title:Text(\"Firestore,CloudVision\")), value: Menu.firestore_cloud_vision,),\n        ],\n      ),\n    );\n  }\n\n  void popupMenuSelected(Menu selectedMenu){\n    switch(selectedMenu) {\n      case Menu.google_sign_in:\n        _pushPage(context, GoogleSignInPage());\n        break;\n      case Menu.firestore_cloud_vision:\n        _pushPage(context, FirestoreCloudVisionPage());\n        break;\n      default:\n        break;\n    }\n  }\n\n  void _pushPage(BuildContext context, Widget page) {\n    Navigator.of(context).push(\n      MaterialPageRoute&lt;void&gt;(builder: (_) =&gt; page)\n    );\n  }\n}\n\nclass MyHomePage extends StatefulWidget {\n  final String message;\n  MyHomePage({this.message}):super() {}\n  @override\n  State&lt;StatefulWidget&gt; createState() =&gt; new MyHomePageState();\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Flutter\u3067\u30a2\u30d7\u30ea\u958b\u767a\u306e\u305f\u3081\u306e\u90e8\u54c1\u3042\u3064\u3081\u3002 Popup\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u306e\u753b\u9762\u9077\u79fb\u3092\u8a66\u3059\u3002 \u4ee5\u4e0b\u306eimport\u306f\u9077\u79fb\u5148\u753b\u9762 .\/google_sign_in.dart Google \u30b5\u30a4\u30f3\u30a4\u30f3\u3092\u8a66\u3059\u753b\u9762 .\/firesto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":921,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[111],"tags":[],"class_list":["post-753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flutter"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":5,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":937,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/753\/revisions\/937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media\/921"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}