Flutter architecture you can use in your projects.

Overview

Flutter Architecture

Projelerinizde kullanabileceğiniz flutter mimarisi. [ Update: 05.01.2022 ]

"lib" klasörünü projenizin lib klasörü ile değiştirerek kullanabilirsiniz. Projenizde kullanılmayacak klasörleri silebilirsiniz.

C# katman mimarisinden esinlenilerek yapılmıştır.

NOT: Gerekli kütüphaneler yüklü değilse hata alabilirsiniz.

Kullanılan kütüphaneler:

  • API Service
    • http
    • dio
  • Widgets
    • animator
    • another_flushbar
  • Other
    • shared_preferences:
    • intl:
    • mask_text_input_formatter:
    • flutter_svg:

Mimari

İş Katmanı ( business )

  • constants: Projede kullanılacak sabitler burada tutulur. Bunlar renk, icon, resim, yazı, yazı formatı gibi alanlar olabilir.

  • helpers: Kodlama yaparken bize yardımcı olacak kodlar burada tutulur.

  • managers: Bazı servislerin bir yerden yönetilmesi gerekir yönetici sınıfları burada tutulur.

  • services: Api istekleri (signIn, signOut, accountGet vs.) burada tutulur.

  • state_managements: Flutter da kullandığımız durum yöneticileri burada tutulur.

UI Katmanı ( ui )

Çekirdek Katman ( core )

  • Bu katman projeden bağımsız olarak çalışan kodlar içerir.

  • Bu katmanı dışarıdan entegre edebilirsiniz.

Model Katmanı ( models )

  • Projede kullanılacak modeller burada tutulur.

Export Katmanı ( exports )

  • import ettiğimiz sınıfları toplu bir halde tutmamızı sağlar.


Ekran Tasarımı

Ekran tasarımı 3 ana bileşen üzerine kurulmuştur. Bu bileşenler tek bir 'dart' dosyası içinde 3 ayrı sınıftan oluşur. Örnek olarak Home ekranını inceleyebilirsiniz.

  • Veri Sınıfı ( _ScreenData ):

    Tasarladığınız ekranda bir veri işlemi varsa (input, dropdown vs.) bu sınıf kullanılır. Ekran açıldığında bu sınıftan bir obje oluşturulur ve gerekli ise doldurulur. Yapılan veri değişiklikleri bu sınıf üzerinden yapılır. Bu şekilde kaydedilmediği sürece o ekranda olanlar o ekranda kalır.

  • Widget Sınıfı ( _ScreenWidgets ):

    Ekran için tasarlanan widgetlar bu sınıf altında bir metot olarak tutulur.

  • Ana Sınıf ( . . . Screen ):

    Bu sınıf ana sınıfımız olacak. Bu sınıfta widget sınıfında hazırladığımız widgetları yerleştireceğiz, konumlarını ayarlayacağız, widgetlar arası boşluklar vereceğiz.


Sonuç olarak widget sınıfında widgetlarımızı ayrı ayrı tasarlayıp, ana sınıfımızda bu widgetları sadece konumlandıracağız. Bu şekilde konum bazlı bir revizeyi ana sınıfta, widget bazlı bir revizeyi widget sınıfında bulup yapabiliriz.


State Managements

Kişisel olarak 'Stateful' yerine 'Stateless' kullanıyorum. Ekranda yapılan kalıcı olmayan anlık değişiklikler (butonu duruma göre değiştirmek vs.) için 'ValueNotifier', anlık olarak ekrana yansıyacak veri değişiklikleri (profil ismi, profil resmi vs.) için 'Bloc' kullanmayı tercih ediyorum.

You might also like...

The definitive landscape virtual keyboard for flutter projects that can't support regular virtual keyboards

The definitive landscape virtual keyboard for flutter projects that can't support regular virtual keyboards

VK Flutter Virtual Keyboard The definitive landscape virtual keyboard for flutte

Dec 13, 2022

Today we will show you how you can create your developer portfolio website and app using flutter.

Today we will show you how you can create your developer portfolio website and app using flutter.

Responsive and Animated Portfolio Website & App - Flutter UI Live Preview Watch it on YouTube Packages we are using: flutter_svg: link goole_fonts: li

Dec 30, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI 1/2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Fl

Dec 6, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI #2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flu

Dec 15, 2022

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Flutter Architecture Blueprints Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to dev

Apr 9, 2022

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Flutter Architecture Blueprints Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to dev

Dec 31, 2022

Flutter-clean-architecture - A simple flutter project developed with TDD and using Clean Architecture principles.

Clean Architecture This is a study project to practice TDD and a good approach of Clean Architecture for flutter projects. It is based on Reso Coder s

Jul 21, 2022

Flutter Architecture inspired by Domain Driven Design, Onion and Clean Architecture

Flutter Architecture inspired by Domain Driven Design, Onion and Clean Architecture

Inspiring Domain Driven Design Flutter Architecture Please take a look at my slides to learn more Strategic Domain Driven Design For Improving Flutter

Dec 25, 2022
Owner
Cihat Yalman
App & Game Developer
Cihat Yalman
A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

easy_tab_controller A user-friendly TabBarController widget for flutter developer. Getting Started This project is a starting point for a Flutter plug

圆号本昊 3 May 26, 2022
Import & use javascript libraries in your flutter web projects

Import JS Library Import & use javascript libraries in your flutter web projects. flutter: assets: - assets/howler.js importJsLibrary(url: "./as

Florent CHAMPIGNY 29 Oct 1, 2022
This is a flutter app which uses the Bitrise Api(https://api-docs.bitrise.io/) to show the bitrise projects and builds and lets you download your artifacts.

Bitrise Artifact Downloader Introduction ??‍♂️ This is a flutter app which uses the Bitrise Api(https://api-docs.bitrise.io/) to show the bitrise proj

Jens Klingenberg 9 Apr 30, 2021
This package will help you to manage the overlays in your projects. Show a dialog, notification, window, or a panel easily

This package will help you to manage the overlays in your projects. Show a dialog, notification, window, or a panel easily. or use one of the helping widgets like AutoComplete, Expander(Dropdown).

Schaban Bochi 25 Dec 4, 2022
This is a mason brick you can use to generate code that get's you started right up with a flutter project

flutter_brick This is a mason brick you can use to generate code that gets you started right up with a flutter project A flutter brick created with th

Bruce Omukoko 3 Sep 16, 2022
dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Md Abir Ahsan Tahmim 1 Dec 8, 2021
An app made in Flutter to help people choose the colors they will use in their projects!

Color Picker An app made in Flutter to help people choose the colors they will use in their projects! Features Pick a color from a picker wheel, palet

Bruno D'Luka 50 Nov 27, 2022
A basic login/register screen that can be used as a template for future Flutter projects.

A Flutter / Firebase login screen A simple flutter/dart based login-screen that connects with Firebase Auth to enable users to sign-in/up with Email o

Kim Andre Langholz 142 Dec 20, 2022