-
Notifications
You must be signed in to change notification settings - Fork 0
Project Structure
├── android
├── assets
│ ├── images
│ └── l10n
├── ios
├── lib
│ ├── components
│ ├── configs
│ ├── core
│ │ ├── classes
│ │ ├── extensions
│ ├── gen
│ ├── models
│ ├── modules
│ │ ├── forgot_password
│ │ │ └── components
│ ├── repositories
│ └── services
├── test
│ ├── fakers
│ ├── helpers
│ │ └── extensions
│ ├── mocks
│ └── modules
│ ├── landing
│ └── login
└── web
ios
, android
, web
They contain native projects so that we can open them with Android Studio or Xcode to build, run or configure it normally like you write the native app.
lib
It contains the source of the flutter project, where we write our hybrid code.
It contains extensions, utility, base classes of the app
It contains common widgets, which can be reused, such: alert, loading spinner...
It contains all configs for the app, such: colors, base URL...
Also, we should not use direct values from config files, instead link them into gen/configs.gen.dart
part 'package:survey/configs/app.dart';
part 'package:survey/configs/factories.dart';
part 'package:survey/configs/routes.dart';
part 'package:survey/configs/colors.dart';
class Configs {
static const app = _AppConfig();
static final factories = _factories;
static final routes = _routes;
static const colors = _ColorsConfig();
const Configs();
}
Then, we can access our configs like this
Configs.colors.red
It contains object models.
Also, each model name requires a suffix Info
, such: UserInfo, BookInfo...
It contains the lowest layer class to work with HTTP requests, databases...
It contains the connecting layer class, combine data from service
and feed to interactor
It contains VIPER modules.
And, each module is a screen in the app (LoginModule, HomeModule..)
assets
It contains all app resources, such: images, fonts, localize strings...
For images and fonts, it will be generated by flutter_gen into gen/assets.dart
test
It contains all test files.
Also, the structure inside the test
directory should match with the lib
directory structure, excepts fakers
, mocks
, helpers
.