Clean Architecture Mobile - Flutter Implementation
Clean Architecture is a fantastic way to look at designing and developing scalable and maintainable software. However, Clean Architecture is very broad and often confusing to implement due to how broad it is in specific scenarios.
Packages Version:
Dart: 2.14.0-178.0.dev
Flutter: 2.3.0-17.0.pre.191
Plugins: ScopedModel => 1.1.0 (UI & Control & Infrastructure) for MVVM.
Getting Started
Installing the Android SDK
You need to install the Android SDK in order to be able to deploy the application to Android devices and simulators.
Windows
Here is a perfect guide on how to install the Android SDK on your windows machine and configure it correctly with flutter.
Mac OS X
Here is a perfect guide on how to install the Android SDK on your mac os x machine and configure it correctly with flutter.
Installing XCode & iOS SDK (Mac only)
Here is a perfect guide to installing and configuring XCode and the iOS SDK & Simulators.
Installing Flutter
You need to install the Flutter SDK by following this guide.
Choosing an IDE
Some IDEs for Flutter mobile application development:
Setting up
Once you have successfully cloned the repository it's time to set up your environment.
Mac OS X
- Open your repository in your chosen IDE. (On opening you may see some errors, do not worry.)
- Open the terminal
- Navigate inside of the terminal to the cloned directory. It will look like this:
cd Desktop/Flutter-Template
- Once you have successfully navigated there you must run the following command to allow the execution of a script I
wrote to download all of the necessary packages.
chmod +x get_packages.sh
- Then run the following command:
./get_packages.sh
- You should see in the terminal the script is now running and downloading all of the relevant packages to your local disk.
Windows
- Open your repository in your chosen IDE. (On opening you may see some errors, do not worry.)
- Navigate to the cloned repository in File Explorer.
- double click get_packages.bat.
- The window will open and then close shortly. Once closed all the relevant packages will have been retrieved.
Running the application
Most IDEs will instantly offer the option at the top of the window to run the template application in a simulator. However, starting a new technology or using a new IDE can often be overwhelming. Here is a guide tailored to IntelliJ, VSCode, Android Studio and simply using a terminal/cmd.
References
Clean Architecture - https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html