0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Flutter最速の開発環境

0
Last updated at Posted at 2026-02-28

想定読者

  • macOS
  • Flutterのバージョンをプロジェクトごとに管理したい
  • fvm flutterとか打つのとかエイリアスつけて fvm使いたくない
  • cocoapodを動かすrubyのバージョンも揃えたい
  • パス通すとかがめんどくさい

miseをinstall

brew install mise

brew以外のやり方知りたい人はこちら

miseをshellで有効化してパスを通して保存

zsh

  • terminal用
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
source ~/.zshrc
  • IDE用
echo 'eval "$(mise activate zsh --shims)"' >> ~/.zprofile
source ~/.zprofile

bash

  • terminal用
echo 'eval "$(mise activate bash)"' >> ~/.bashrc
source ~/.bashrc
  • IDE用
echo 'eval "$(mise activate bash --shims)"' >> ~/.bash_profile
source ~/.bash_profile

プロジェクトを作成

mkdir sample_app
cd sample_app

mise.tomlファイル作成

プロジェクトルートに作成

mise.toml
[tools]
flutter = "3.41.2"
ruby = "3.3.4"
mise trust
  • flutter をinstall
mise i flutter
  • rubyもinstall
mise i ruby

確認

mise current
flutter 3.41.2
ruby 3.3.4

flutterプロジェクト作成

webはいらなかったのでplatformオプションを追加

flutter create --platforms ios,android .

cocoapodを導入

sudo gem install cocoapods
cd ios 
pod install --repo-update

pubspec.yamlを更新

綺麗にして、明示的にsdk: ">=3.11.0 <4.0.0" とだけ変更

pubspec.yaml
name: sample_app
description: "A new Flutter project."

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=3.11.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^6.0.0

flutter:
  uses-material-design: true

追記

setting.json
  "dart.getFlutterSdkCommand": {
    "executable": "mise",
    "args": ["where", "flutter"],
  }

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?