{"action":"created","issue":{"url":"https://api.github.com/repos/aloerina01/til/issues/3","repository_url":"https://api.github.com/repos/aloerina01/til","labels_url":"https://api.github.com/repos/aloerina01/til/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/aloerina01/til/issues/3/comments","events_url":"https://api.github.com/repos/aloerina01/til/issues/3/events","html_url":"https://github.com/aloerina01/til/issues/3","id":328009983,"node_id":"MDU6SXNzdWUzMjgwMDk5ODM=","number":3,"title":"2018/05/31","user":{"login":"aloerina01","id":4443321,"node_id":"MDQ6VXNlcjQ0NDMzMjE=","avatar_url":"https://avatars2.githubusercontent.com/u/4443321?v=4","gravatar_id":"","url":"https://api.github.com/users/aloerina01","html_url":"https://github.com/aloerina01","followers_url":"https://api.github.com/users/aloerina01/followers","following_url":"https://api.github.com/users/aloerina01/following{/other_user}","gists_url":"https://api.github.com/users/aloerina01/gists{/gist_id}","starred_url":"https://api.github.com/users/aloerina01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aloerina01/subscriptions","organizations_url":"https://api.github.com/users/aloerina01/orgs","repos_url":"https://api.github.com/users/aloerina01/repos","events_url":"https://api.github.com/users/aloerina01/events{/privacy}","received_events_url":"https://api.github.com/users/aloerina01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T06:30:00Z","updated_at":"2018-05-31T06:30:22Z","closed_at":null,"author_association":"OWNER","body":"# dart * flutter 入門\r\n\r\n#### dartのインストール\r\n```\r\nbrew tap dart-lang/dart\r\nbrew install dart --with-content-shell --with-dartium\r\n```\r\n\r\n\r\n#### flutterのインストール\r\n[Get Started: Install on macOS  - Flutter](https://flutter.io/setup-macos/)\r\n\r\n```\r\nflutter doctor\r\n```\r\nこれで開発環境の不足を教えてくれる\r\n\r\n```\r\nDoctor summary (to see all details, run flutter doctor -v):\r\n[- [x] ] Flutter (Channel beta, v0.4.4, on Mac OS X 10.12.6 16G1212, locale ja-JP)\r\n[✗] Android toolchain - develop for Android devices\r\n**✗ Unable to locate Android SDK.**\r\n**Install Android Studio from: https://developer.android.com/studio/index.html**\r\n**On first launch it will assist you in installing the Android SDK components.**\r\n**(or visit https://flutter.io/setup/#android-setup for detailed instructions).**\r\n**If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.**\r\n[!] iOS toolchain - develop for iOS devices\r\n**✗ Xcode installation is incomplete; a full installation is necessary for iOS development.**\r\n**Download at: https://developer.apple.com/xcode/download/**\r\n**Or install Xcode via the App Store.**\r\n**Once installed, run:**\r\n**sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer**\r\n**✗ libimobiledevice and ideviceinstaller are not installed. To install, run:**\r\n**brew install --HEAD libimobiledevice**\r\n**brew install ideviceinstaller**\r\n**✗ ios-deploy not installed. To install:**\r\n**brew install ios-deploy**\r\n**✗ CocoaPods not installed.**\r\n**CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.**\r\n**Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.**\r\n**For more info, see https://flutter.io/platform-plugins**\r\n**To install:**\r\n**brew install cocoapods**\r\n**pod setup**\r\n[✗] Android Studio (not installed)\r\n[!] VS Code (version 1.23.1)\r\n[!] Connected devices\r\n    ! No devices available\r\n\r\n! Doctor found issues in 5 categories.\r\n```\r\n\r\n#### vscodeのPluginをインストール\r\nhttps://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code\r\ndart & flutter 用らしいのでとりあえずこれひとつのみインストール\r\n\r\nvscodeのコマンドパレットで`Flutter: New Project`をしようとしたらFlutterSDKがないと怒られたので設定を開いて修正。\r\n```\r\n\"dart.flutterSdkPath\": \"/Users/aloerina/flutter\",\r\n```\r\n\r\nNew Projectに成功したらHelloWorld的なコードがすでに入っていた\r\n\r\n#### 実行する前に「どのデバイスで動かすか」を決めないといけない\r\n→まずはAndroidエミュレータで。\r\n\t→AndroidStudioのAVDで。 [公式](https://developer.android.com/studio/run/managing-avds#viewing)\r\n\r\nエミュレータ起動したらvscodeの右下の「No devices」の部分が「Android SDK built for x86」に勝手に変わった\r\n\r\n#### 実行する\r\n```\r\nflutter run\r\n```\r\nで実行したらGradleエラーが出た。\r\n\r\n```\r\n~/p/flutter_sample ❯❯❯ flutter run                                                                                                                                                                                                                             master\r\nUsing hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with \"--enable-software-rendering\".\r\nLaunching lib/main.dart on Android SDK built for x86 in debug mode...\r\nInitializing gradle...                                      14.1s\r\nResolving dependencies...                                       |\r\n\r\n* Error running Gradle:\r\nUnable to download needed Android SDK components, as the following licenses have not been accepted:\r\nAndroid SDK Build-Tools 26.0.2\r\n\r\nTo resolve this, please run the following command in a Terminal:\r\nflutter doctor --android-licenses\r\n```\r\n\r\nflutter doctor で対処法を教えてくれるのがやばいすごい\r\n\r\n言われたとおりに`flutter doctor —android-licenses`したらAcceptしていないライセンスが次々に表示されて、コマンドライン上で承認したら完了した。便利。\r\n\r\nもう一度`flutter run`で成功\r\n```\r\n🔥  To hot reload your app on the fly, press \"r\". To restart the app entirely, press \"R\".\r\n```\r\nホットリロードの準備できてるってよ。\r\nコードの一部書き換えてコマンドライン上で`R`押したら画面がバチッと切り替わる。けっこう一瞬(1s未満)。はやい。\r\n\r\nあとすごく感動したのが、Dartが普通に読める。何も困らない。初めて触る言語とは思えない。"},"comment":{"url":"https://api.github.com/repos/aloerina01/til/issues/comments/393421709","html_url":"https://github.com/aloerina01/til/issues/3#issuecomment-393421709","issue_url":"https://api.github.com/repos/aloerina01/til/issues/3","id":393421709,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzQyMTcwOQ==","user":{"login":"aloerina01","id":4443321,"node_id":"MDQ6VXNlcjQ0NDMzMjE=","avatar_url":"https://avatars2.githubusercontent.com/u/4443321?v=4","gravatar_id":"","url":"https://api.github.com/users/aloerina01","html_url":"https://github.com/aloerina01","followers_url":"https://api.github.com/users/aloerina01/followers","following_url":"https://api.github.com/users/aloerina01/following{/other_user}","gists_url":"https://api.github.com/users/aloerina01/gists{/gist_id}","starred_url":"https://api.github.com/users/aloerina01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aloerina01/subscriptions","organizations_url":"https://api.github.com/users/aloerina01/orgs","repos_url":"https://api.github.com/users/aloerina01/repos","events_url":"https://api.github.com/users/aloerina01/events{/privacy}","received_events_url":"https://api.github.com/users/aloerina01/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T06:30:22Z","updated_at":"2018-05-31T06:30:22Z","author_association":"OWNER","body":"<img width=\"297\" alt=\"2018-05-31 14 59 45\" src=\"https://user-images.githubusercontent.com/4443321/40765487-850a24f2-64e7-11e8-808c-cd8c3c8a1b06.png\">\r\n"}}
{"actor":{"display_login":"aloerina01"}}