Welcome, fellow developers! Today, we’re embarking on an adventure through the multiverse of app development as we build a simple yet effective application demonstrating Clean Architecture using GraphQL and the Flutter framework. Fasten your seatbelts, as we delve into the technical wonders!
Understanding the Motivation
As the illustrious Martin Fowler expressed, “Good programmers write code that humans can understand.” This guide embodies that ethos, aiming to construct a production-grade application while prioritizing readability and maintainability. Let’s roll up our sleeves!
Key Features of our Application
- CI/CD integration using GitHub Actions
- Githooks for clean commits and pushes
- Automatic formatting with Flutter
- Static code analysis and testing hooks
- Linting with Effective Dart
- Test coverage measurement with Codecov
- Dependency injection using injectable and get_it
- Testing utilizing mockito and bloc_test
Installation Steps
Ready to get started? Follow these simple steps:
- Ensure you are using the beta channel of the Flutter SDK, version v2.0.1 or higher. For instructions on switching Flutter channels, check out this guide.
- Clone the repository:
- Navigate to the project directory and run the following commands to build and run the app:
- If you experience issues with any auto-generated files such as *.freezed.dart, *.g.dart, or *.iconfig.dart, simply regenerate them with:
git clone https://github.com/excogitar/rick-and-morty-info.git
flutter pub get
flutter run
flutter pub run build_runner watch --delete-conflicting-outputs
Code Explanation with an Analogy
Imagine you’re building a treehouse (our app) in a vast forest (the Flutter ecosystem). Each branch of the tree represents a different component: the trunk signifies the core structure of your app that connects all parts.
The branches (features) grow in organized layers, directed by the rules of Clean Architecture. The leaves (widgets) are what users see and interact with. Auto-generated files act like tools in your toolbox, ensuring everything is well-maintained and functional. This treehouse stands strong because it follows a clear design—just like our app adheres to best practices.
Troubleshooting
If you run into any challenges while setting up or running the app, here are some common solutions:
- Ensure your Flutter SDK is up to date and correctly set to the required channel.
- Check for typos during repository cloning or while running commands.
- If you face issues with auto-generated files, make sure to regenerate them using the provided command.
- For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Thanks To…
A huge shout-out to the pioneers of Clean Architecture, including Uncle Bob, ResoCoder for style guidance, and Felangel for their fantastic state management solution. Special thanks to Axel Fuhrmann for providing the Rick and Morty GraphQL API.
Final Thoughts
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations. Happy coding, and may your code be clean and efficient!

