Flutter
ナビゲーションに移動
検索に移動
Flutter
Install
Mac
開発者登録
インストール
- sdkダウンロード
- unzipで解凍
- .bash_profile にPATH登録
- flutter doctor コマンドで必要な作業のチェックとヘルプ
実行
- xcodeのダウンロード
- command line tools の有効化
- sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
- sudo xcodebuild -runFirstLaunch
- cocoapods のインストール
- sudo gem install cocoapods
- pod setup
- シミュレーターの起動
- open - a Simulator
- プロジェクトの作成
- flutter create my_app
- プロジェクトディレクトリで、
- flutter run
Firebase
- プロジェクトフォルダで以下を実行しXcodeで
- open ios/Runner.xcworkspace
- Firebase にバンドルIDを登録
- cd ios
- pod setup
- https://developers.google.com/identity/sign-in/ios/start-integrating
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods
環境構築
Firebase
Flutterfire
- https://github.com/FirebaseExtended/flutterfire
Firebase Auth
example
- https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/example
Google Sign in
example
Tips
AndroidX対応
メニュー
ドロワーメニュー
return Scaffold( appBar: AppBar(), drawer: Drawer(), body: Center(), );
画面遷移
呼び出し元
RaisedButton( onPressed: (){ Navigator.push( context, MaterialPageRoute(builder: (context) => SecondRoute()), ); }, child: const Text('Open Second Screen'),
呼び出し先
import 'package:flutter/material.dart'; class SecondRoute extends StatefulWidget { @override State<StatefulWidget> createState() { return _SecondRouted(); } } class _SecondRouted extends State<SecondRoute> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: Center(), ); } }
Dialog
画像選択
画像切り抜き
DB
Sqlite
© 2006 矢木浩人