Skip to content

Commit 8bcd281

Browse files
[Updated README.md]
1 parent a9a6329 commit 8bcd281

File tree

2 files changed

+145
-9
lines changed

2 files changed

+145
-9
lines changed

README.md

+145-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,89 @@
1-
# rorty_flutter
1+
[![CodeStyle](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg?style=for-the-badge)](https://dart.dev/tools/linter-rules)
2+
[![Flutter](https://img.shields.io/badge/Flutter-0078D6?style=for-the-badge&logo=flutter&logoColor=white)](https://flutter.dev/)
3+
[![Dart](https://img.shields.io/badge/Dart-343a40?style=for-the-badge&logo=dart&logoColor=white)](https://dart.dev/)
4+
[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
25

3-
Rick and Morty
6+
<p align="center">
7+
<img height="250" src="art/flutter-logo.webp"/>
8+
</p>
9+
10+
<h1 align="center"> Rorty Flutter </h1>
411

512
## Getting Started
613

7-
This project is a starting point for a Flutter application.
14+
Flutter Clean Architecture in Rorty is a sample project that presents modern, approach to [Flutter](https://flutter.dev/) application development using [Dart](https://dart.dev/) and latest tech-stack.
15+
16+
The goal of the project is to demonstrate best practices, provide a set of guidelines, and present modern Flutter
17+
application architecture that is modular, scalable, maintainable and testable. This application may look simple, but it
18+
has all of these small details that will set the rock-solid foundation of the larger app suitable for bigger teams and
19+
long application lifecycle management.
20+
21+
A flutter app built using Kotlin that consumes [Rick and Morty API](https://rickandmortyapi.com) to display characters,episodes,Location from the [TV Series](https://www.imdb.com/title/tt2861424/). It has been built following Clean Architecture Principle, Repository Pattern, MVVM Architecture in the presentation layer.
22+
23+
## Architecture
24+
A well planned architecture is extremely important for an app to scale and all architectures have one common goal- to manage complexity of your app. This isn't something to be worried about in smaller apps however it may prove very useful when working on apps with longer development lifecycle and a bigger team.
25+
26+
Clean architecture was proposed by [Robert C. Martin](https://en.wikipedia.org/wiki/Robert_C._Martin) in 2012 in the [Clean Code Blog](http://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) and it follow the SOLID principle.
27+
28+
<p align="center"><img src="art/clean_arch.jpeg" alt="Clean Architecture"></p>
29+
30+
The circles represent different layers of your app. Note that:
31+
32+
- The center circle is the most abstract, and the outer circle is the most concrete. This is called the [Abstraction Principle](https://en.wikipedia.org/wiki/Abstraction_principle_(computer_programming)). The Abstraction Principle specifies that inner circles should contain business logic, and outer circles should contain implementation details.
33+
34+
- Another principle of Clean Architecture is the [Dependency Inversion](https://en.wikipedia.org/wiki/Dependency_inversion_principle). This rule specifies that each circle can depend only on the nearest inward circle ie. low-level modules do not depend on high-level modules but the other way around.
35+
36+
<p align="center"><img src="art/architecture.png" alt="Clean Architecture Diagram"></p>
37+
38+
### Why Clean Architecture?
39+
- ```Loose coupling between the code``` - The code can easily be modified without affecting any or a large part of the app's codebase thus easier to scale the application later on.
40+
- Easier to ```test``` code.
41+
- ```Separation of Concern``` - Different modules have specific responsibilities making it easier for modification and maintenance.
42+
43+
### S.O.L.I.D Principles
44+
45+
- [__Single Responsibility__](https://en.wikipedia.org/wiki/Single-responsibility_principle): Each software component should have only one reason to change – one responsibility.
46+
47+
- [__Open-Closed__](https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle#:~:text=In%20object%2Doriented%20programming%2C%20the,without%20modifying%20its%20source%20code.): You should be able to extend the behavior of a component, without breaking its usage, or modifying its extensions.
48+
49+
- [__Liskov Substitution__](https://en.wikipedia.org/wiki/Liskov_substitution_principle): If you have a class of one type, and any subclasses of that class, you should be able to represent the base class usage with the subclass, without breaking the app.
50+
51+
- [__Interface Segregation__](https://en.wikipedia.org/wiki/Interface_segregation_principle): It’s better to have many smaller interfaces than a large one, to prevent the class from implementing the methods that it doesn’t need.
52+
53+
- [__Dependency Inversion__](https://en.wikipedia.org/wiki/Dependency_inversion_principle): Components should depend on abstractions rather than concrete implementations. Also higher level modules shouldn’t depend on lower level modules.
54+
55+
## Layers
56+
57+
### Project Structure
58+
<p align="center"><img src="art/project.png" alt="Project Structure" width="500"></p>
59+
60+
### Data
61+
The ```data``` layer is responsible for selecting the proper data source for the domain layer. It contains the implementations of the repositories declared in the domain layer.
62+
63+
Components of data layer include:
64+
- __model__
65+
66+
-__dto__: Defines dto of ui model, also perform data transformation between ```domain```, ```response``` and ```entity``` models.
67+
68+
-__local__: Defines the schema of SQLite database.
869

9-
A few resources to get you started if this is your first Flutter project:
70+
-__remote__: Defines POJO of network responses.
1071

11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
72+
- __local__: This is responsible for performing caching operations using [Floor](https://pub.dev/packages/floor).
73+
74+
- __remote__: This is responsible for performing network operations eg. defining API endpoints using [Retrofit/Dio](https://pub.dev/packages/retrofit).
75+
76+
- __repository__: Responsible for exposing data to the domain layer.
77+
78+
### Domain
79+
This is the core layer of the application. The ```domain``` layer is independent of any other layers thus ] domain business logic can be independent from other layers.This means that changes in other layers will have no effect on domain layer eg. screen UI (presentation layer) or changing database (data layer) will not result in any code change withing domain layer.
80+
81+
Components of domain layer include:
82+
- __usecase__: They enclose a single action, like getting data from a database or posting to a service. They use the repositories to resolve the action they are supposed to do. They usually override the operator ```invoke``` , so they can be called as a function.
83+
84+
### Presentation
85+
The ```presentation``` layer contains components involved in showing information to the user. The main part of this layer are the Views(widgets) and ViewModels.
1386

14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials, samples, guidance on
16-
mobile development, and a full API reference.
1787

1888
## Screenshots
1989

@@ -68,3 +138,69 @@ mobile development, and a full API reference.
68138
<td><img src="art/screenshots/web/home-dark.png"></td>
69139
</tr>
70140
</table>
141+
142+
# Tech Stacks
143+
This project uses many of the popular libraries, plugins and tools of the android ecosystem.
144+
- [Stacked](https://pub.dev/packages/stacked) - An architecture and widgets for an MVVM inspired architecture in Flutter.
145+
- [Provider](https://pub.dev/packages/provider) - A wrapper around InheritedWidget to make them easier to use and more reusable.
146+
- [Get It](https://pub.dev/packages/get_it) - Dependency Injection library.
147+
- [Retrofit](https://pub.dev/packages/retrofit) - A dio client generator using source_gen and inspired by Chopper and Retrofit.
148+
- [Dio](https://pub.dev/packages/dio) - A powerful Http client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout etc.
149+
- [Go Router](https://pub.dev/packages/go_router) - A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more.
150+
- [Flutter Native Splash](https://pub.dev/packages/flutter_native_splash) - Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more.
151+
- [Shared Preferences](https://pub.dev/packages/shared_preferences) - Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
152+
- [Easy Localization](https://pub.dev/packages/easy_localization) - Easy and Fast internationalizing and localization your Flutter Apps.
153+
- [Url Launcher](https://pub.dev/packages/url_launcher) - Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.
154+
- [Floor](https://pub.dev/packages/floor) - The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications.
155+
- [Logger](https://pub.dev/packages/logger) - Small, easy to use and extensible logger which prints beautiful logs.
156+
157+
### Code Analyze Tools
158+
- [Lints](https://pub.dev/packages/flutter_lints) - This package contains a recommended set of lints for Flutter apps, packages, and plugins to encourage good coding practices.
159+
160+
## 🚀 Posts In Medium
161+
[Article](...)
162+
163+
## 🤝 Contributing
164+
165+
Contributions are what make the open source community such an amazing place to be learn, inspire,
166+
and create. Any contributions you make are **greatly appreciated**.
167+
168+
1. Open an issue first to discuss what you would like to change.
169+
2. Fork the Project
170+
3. Create your feature branch (`git checkout -b feature/amazing-feature`)
171+
4. Commit your changes (`git commit -m 'Add some amazing feature'`)
172+
5. Push to the branch (`git push origin feature/amazing-feature`)
173+
6. Open a pull request
174+
175+
Please make sure to update tests as appropriate.
176+
177+
## ✍️ Authors
178+
179+
<a href="https://www.linkedin.com/in/mesut-g-33b41030" target="_blank">
180+
<img src="https://avatars.githubusercontent.com/u/30066734?v=4" width="70" align="left">
181+
</a>
182+
183+
👤 **developersancho**
184+
185+
[![Linkedin](https://img.shields.io/badge/-linkedin-0077B5?style=for-the-badge&logo=linkedin)](https://www.linkedin.com/in/mesut-g-33b41030/)
186+
[![Medium](https://img.shields.io/badge/-medium-12100E?style=for-the-badge&logo=medium)](https://developersancho.medium.com/)
187+
188+
Feel free to ping me 😉
189+
190+
## License
191+
192+
```license
193+
Copyright © 2022 - developersancho
194+
195+
Licensed under the Apache License, Version 2.0 (the "License");
196+
you may not use this file except in compliance with the License.
197+
You may obtain a copy of the License at
198+
199+
http://www.apache.org/licenses/LICENSE-2.0
200+
201+
Unless required by applicable law or agreed to in writing, software
202+
distributed under the License is distributed on an "AS IS" BASIS,
203+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204+
See the License for the specific language governing permissions and
205+
limitations under the License.
206+
```

art/flutter-logo.webp

35.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)