Flutter authentication app showcasing Clean Architecture, BLoC pattern, and dependency injection.

The secret behind smooth transition between the login screen and home screen is the fact that the last frame of the login screen matches perfectly with the first frame of the home screen.

Let’s take a closer look at the login screen.

Creating a login project with Flutter

Flutter Authentication Application

This is a Flutter authentication app showcasing Clean Architecture, BLoC pattern, and dependency injection. It uses Firebase for authentication and provides a solid foundation for building scalable, maintainable Flutter applications.

Features

  • User Authentication: Allows users to sign up, log in, and log out securely using Firebase Authentication.
  • Clean Architecture: Follows a modular and structured approach for better code organization, testability, and maintainability.
  • BLoC Pattern: Utilise the BLoC pattern for state management to keep UI and business logic separated.
  • Dependency Injection: Implements dependency injection for better code decoupling and testability using get_it.

Screenshots

<img fetchpriority=
Flutter login signup authentication app

Getting Started

  1. Clone the repository:
git clone https://github.com/Ibrahim-Rafei/flutter_clean_architecture_authentication.git
  1. Navigate to the project directory:
cd flutter_clean_architecture_authentication
  1. Install dependencies:
flutter pub get
  1. Run the app:
flutter run

Configuration

Before running the app, you need to set up Firebase and add the configuration files. Follow these steps:

  1. Create a new Firebase project on the Firebase Console.
  2. In your Firebase project, navigate to the Authentication section and enable the Email/Password sign-in method.
  3. Follow the Firebase documentation for setting up the required authentication methods.
  4. Add the Firebase configuration file to the project:
    • For Android: Download the google-services.json file and place it in android/app/google-services.json.
    • For iOS: Download the GoogleService-Info.plist file and place it in ios/Runner/GoogleService-Info.plist.
  5. That’s it! Your Flutter app is now connected to Firebase for authentication.

Architecture

This project follows the Clean Architecture principles for better separation of concerns and scalability:

  • Presentation Layer: Contains the UI components, BLoCs, and Widgets.
  • Domain Layer: Contains the business logic and entities. It is independent of any external frameworks.
  • Data Layer: Manages data sources, repositories, and data models. It interacts with external services like Firebase.
  • Injection Layer: Handles dependency injection using the get_it package.

Testing

To run the tests, use the following command:

flutter run

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is in the public domain. You are free to use, modify, and distribute it without any restrictions.

Acknowledgments

Resources Used:

Login and Register app UI screen with flutter source code

Get Full Source Code

View Github

Conclusion

This was all about a quick go through the basic flutter App UI Screen. If you need any assistance regarding flutter app development, you can consult a flutter developer from FlutterDesk. We would love to be of help. Still, if you feel any difficult while dealing with Flutter app development projects, you can reach out to us or hire Flutter developers to outsource any of your app development project.

Do like & share my Facebook page. if you find this post helpful. Thank you!!

Happy coding! 😉

Related Articles:

READ MORE


Deepika

Hey, I'm Deepika, Experienced in Mobile app Development (Flutter, Android and iOS) and professional blogger. Technically sound Post graduated M.Tech in Computer Science and Engineering. I Love to gain every type of knowledge that's why i have done many courses in different fields like engineering and technology. Skilled in Flutter,( Dart ), Java, HTML, CSS, PHP, Python, SQL, C, C++,Firebase,MySQL,SQLite,JavaScript, Networking, Ethical Hacking.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *