Skip to content

abdelrahman-abied/Flutter-Multi-User-Theming-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Multi-User Theming App

This is a Flutter application that demonstrates a scalable and maintainable approach to handling different themes for multiple user types. The project leverages the Riverpod state management library and employs the Factory and Strategy design patterns to create a clean, organized codebase.

Demo

Features

  • Multi-User Theming: The app's theme dynamically changes based on the logged-in user's type (basic, premium, or admin).

  • State Management with Riverpod: User state is managed globally using a StateProvider, allowing the UI to reactively update when the user changes.

  • Factory Pattern: A UserFactory class centralizes the logic for creating and configuring a User object, ensuring that each user type is correctly initialized with its specific features.

  • Strategy Pattern: The Feature abstract class and its concrete implementations (BasicFeature, AdvancedFeature, AdminFeature) define different behaviors (e.g., canEdit()), which are then applied to each user type. This makes the code highly extensible without large if/else statements.

  • Modular Code: Themes for each user type are defined as separate ThemeData objects, keeping the styling logic distinct and easy to modify.

Getting Started

To run this project, make sure you have the Flutter SDK installed.

  1. Clone this repository or copy the code into a new Flutter project.

  2. Install the required packages by running flutter pub get in your terminal.

  3. Run the app:

       flutter run

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors