Slide 1

Slide 1 text

Project structure and architecture Billy Taing @IAIAO 2024-04-17

Slide 2

Slide 2 text

What to discuss 1 2 3 4 5 Introduction Architecture & Folder Structure Packages & Tools Demo Conclusion

Slide 3

Slide 3 text

Introduction

Slide 4

Slide 4 text

You can apply it everywhere Adapt depending on purpose My opinionated version of architecture Names/terms might be different + + + Disclaimer +

Slide 5

Slide 5 text

Foundation 2 3 4 1 Maintainable Project easy to read and to find issues Stable Following rules and principles Flexible Able to add or remove any features anytime Testable Able to test individually each part 5 Homogeneous Easy for the team to contribute

Slide 6

Slide 6 text

Architecture & Folder Structure Application

Slide 7

Slide 7 text

“ … are typical solutions to commonly occurring problems in software design. They are like pre-made blueprints that you can customize to solve a recurring design problem in your code. Design Patterns refactoring.guru

Slide 8

Slide 8 text

Dependencies Compose layers with logic or component needed Rules & Principles 2 3 4 1 Layers Presenter, Domain, Data and inner layers are independent Domain Split feature in different context

Slide 9

Slide 9 text

Layers Domain Domain Feature (Settings) Presentation Domain Data Widget Component used in pages Example: Section widget Custom input Page Widget that represent a page or a route to the app Example: Settings page Profile page Use Case Action to perform Example: Save profile Clear cache Controller Handles user actions and update the UI Example: Profile controller Preferences controller Entity Model of the domain Example: Profile Preference Repository Interface of the data layer Example: Profile repository Preference repository Repository Implementa- tion based on the data source Example: Database profile In memory preferences Model Representa- tion of the data source model Example: Profile Preference Data Source Data execution layer Example: SQL In memory

Slide 10

Slide 10 text

Explanation by example Euclidean division

Slide 11

Slide 11 text

Presentation

Slide 12

Slide 12 text

Presentation

Slide 13

Slide 13 text

Domain

Slide 14

Slide 14 text

Domain

Slide 15

Slide 15 text

Data

Slide 16

Slide 16 text

Data

Slide 17

Slide 17 text

Folder Structure

Slide 18

Slide 18 text

Packages & Tools

Slide 19

Slide 19 text

Packages bloc flutter_bloc equatable get_it injectable injectable_generator gap fpdart fvm

Slide 20

Slide 20 text

Linter

Slide 21

Slide 21 text

Tools

Slide 22

Slide 22 text

D E M O

Slide 23

Slide 23 text

“Thank you.” — Billy Taing 😹 /billyandco/flutter_clean_stuff /in/taingbilly

Slide 24

Slide 24 text

THANK YOU! v 😹/billyandco/flutter_clean_stuff /in/taingbilly