1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Flutterのlibディレクトリの例

Posted at

初めに

Flutterのlibディレクトリをどうするのが良いのか、初めめちゃくちゃ悩んだので
現在よく利用している分け方を紹介します。

libディレクトリの例

lib
├── main.dart
├── commons
├── configs
├── enums
├── models
│   ├── firestore
│   └── providers
├── services
└── views
    ├── atoms
    ├── molecules
    ├── organisms
    ├── pages
    └── templates
  • viewの中身は、atomic designで分割
  • modelsはデータを保有
  • servicesは、ロジックを保有
  • configは、環境変数系
  • enumsは、全体で利用するenumを保有
  • commonsは、共通処理を保有

最後に

今の現状がこの構造になっているだけで、今後も変わっていくと思います。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?