Skip to content

enescerrahoglu/template_app_bloc

Repository files navigation

Template App with flutter_bloc

[🇺🇸] This project provides an application template using the bloc state management method with Flutter. The project includes user CRUD (Create, Read, Update, Delete) operations and authentication, serving as a realistic example for real-world scenarios. In order to prove that native-looking applications can be developed with Flutter if desired, Cupertino widgets were preferred instead of Material widgets in the user interface of the project.
The current latest version of Flutter [3.19.5] was used during the development process.

[🇹🇷] Bu proje, Flutter ile bloc state management yöntemini kullanarak bir uygulama şablonu sağlar. Proje, kullanıcı CRUD (Create, Read, Update, Delete) işlemleri ve kimlik doğrulama işlemlerini içerir ve gerçek dünya senaryolarına uygun bir örnek sunar. Flutter ile istenirse native görünümlü uygulamalar geliştirilebileceğini kanıtlamak amacıyla projenin kullanıcı arayüzünde Material widgetlar yerine Cupertino widgetlar tercih edildi.
Geliştirme sürecinde Flutter'ın güncel son sürümü [3.19.5] kullanıldı.

TEMPLATE_APP

Getting Started

API Integration

[🇺🇸] A Rest API is used for user operations, and the API code is not included in this repository. You can develop API endpoints according to the UserModel class in the project to make it suitable for use. You need to update the BASE_URL value in the '.env' file content to match your API structure. You can find the naming used for CRUD and authentication endpoints in the UserService class, and you may need to revise it according to your API structure.

[🇹🇷] Kullanıcı işlemleri için Rest API kullanılmıştır ve API kodları bu repoya dahil değildir. Projedeki UserModel sınıfına uygun API endpointlerini geliştirerek kullanıma uygun hale getirebilirsiniz. Oluşturacağınız API'nin BASE_URL değerini '.env' dosyası içeriğinde güncellemeniz gerekmektedir. UserService sınıfında CRUD ve kimlik doğrulama endpointleri için kullanılan isimlendirmeleri bulabilir ve kendi API yapınıza göre revize etmeniz gerekebilir.

Firebase Integration

[🇺🇸] The project uses Storage for uploading images and accessing them via URL, Extensions and Firestore Database for email infrastructure and Functions for triggering email sending. Therefore, you will need a Firebase project. Since the firebase_options.dart file is not included in the Template App project content, it will throw an error when you clone the repo. Perform Firebase integration to add this file to the project.

[🇹🇷] Projede görselleri yüklemek ve görsellere URL değerleri ile erişmek için Storage, e-posta altyapısı için Extensions ve Firestore Database, e-posta gönderimini tetiklemek için Functions servisleri kullanılmaktadır. Bu nedenle, Firebase projesine ihtiyacınız olacaktır. Template App proje içeriğinde firebase_options.dart dosyası mevcut olmadığından repoyu cloneladığınızda hata verecektir. Firebase entegrasyonunu gerçekleştirerek bu dosyanın projeye eklenmesini sağlayın.

Firebase Trigger Email Extension Integration

[🇺🇸] For email verification, a verification code is sent to the email address provided by the user. The Firebase Trigger Email extension is used for email infrastructure. You need to activate this extension via the Firebase console. Besides verification code sending, the email infrastructure is used for different scenarios as well. Email sending is triggered by Firebase Cloud Functions.

[🇹🇷] Projede e-posta adresi doğrulaması için kullanıcının girdiği e-posta adresine doğrulama kodu iletilmektedir. E-posta altyapısı için Firebase'in sunduğu Trigger Email eklentisi kullanılmıştır. Bu eklentiyi Firebase konsolu üzerinden aktifleştirmeniz gerekir. Doğrulama kodu gönderimi dışında farklı senaryolar için de e-posta altyapısı kullanılmaktadır. E-posta gönderimi Firebase Cloud Functions ile tetiklenmektedir.

Firebase Cloud Functions Integration

[🇺🇸] The project already includes the functions folder and firebase.json file to be added with Cloud Functions. If you specify that the functions/index.js file should be overwritten while integrating cloud functions, you will delete the cloud functions that you need to deploy for the email infrastructure from the file. You can skip the overwrite step with the "No" option, or if it is overwritten, you can copy and deploy the functions again from the relevant file in this Github repo.

[🇹🇷] Projede, Cloud Functions ile eklenecek olan functions klasörü ve firebase.json dosyası zaten mevcut, cloud functions'ı entegre ederken functions/index.js dosyasının overwrite olmasını belirtirseniz email altyapısı için deploy etmeniz gereken cloud fonksiyonlarını dosyadan silmiş olursunuz. Overwrite adımını "No" seçeneği ile geçebilirsiniz ya da üzerine yazılırsa, bu Github reposundaki ilgili dosyadan fonksiyonları tekrar kopyalayıp deploy edebilirsiniz.

Screenshoots

[🇺🇸] Hover the mouse cursor over the images for explanations.
[🇹🇷] Açıklamalar için mouse imlecini resimlerin üzerinde bekletin.

Problems you may encounter

[🇺🇸] To prevent [...lowerCamelCase identifier] problems caused by the easy_localization package, it will be sufficient to add the [constant_identifier_names: false] definition under the [rules:] statement in the analysis_options.yaml file in the project directory.

[🇹🇷] easy_localization paketinden kaynaklı olarak [...lowerCamelCase identifier] problemlerini engellemek için proje dizininde yer alan analysis_options.yaml dosyasında [rules:] ifadesinin altına [constant_identifier_names: false] tanımlamasını eklemeniz yeterli olacaktır.

problem_1

Things to know

[🇺🇸] After adding new string definitions to the [language-code].json (such as en.json, tr.json) file, run the following codes in the terminal one by one so that the easy_localization structure can recognize these changes:

[🇹🇷] [language-code].json (en.json, tr.json gibi) dosyasına yeni string tanımları ekledikten sonra easy_localization yapısının bu değişiklikleri tanıyabilmesi için aşağıdaki kodları terminalde tek tek çalıştırın:

dart run easy_localization:generate --source-dir assets/translations
dart run easy_localization:generate -S assets/translations -f keys -o locale_keys.g.dart