This repository serves as a boilerplate for starting new Flutter projects efficiently. It provides a clean architecture setup, pre-configured features, and utility files to help you focus on building your application logic.
A well-organized folder structure:
lib/
core/
common/
widgets/
cubits/
depandancy_injection/
service_locator.dart
enums/
enums.dart
network/
dio_client.dart
interceptors.dart
usecase/
usecase.dart
utils/
constants/
api_constants.dart
colors.dart
enums.dart
image_strings.dart
sizes.dart
text_strings.dart
device/
device_utility.dart
errors/
exceptions.dart
firebase_auth_exceptions.dart
firebase_exceptions.dart
format_exceptions.dart
platform_exceptions.dart
shared_preferences_exception_helper.dart
formatters/
formatter.dart
helpers/
app_bloc_observer_helper.dart
dio_exception_helper.dart
helper_functions.dart
logger_helper.dart
theme/
widget_themes/
appbar_theme.dart
bottom_sheet_theme.dart
checkbox_theme.dart
chip_theme.dart
elevated_button_theme.dart
outlined_button_theme.dart
text_field_theme.dart
text_theme.dart
theme.dart
validators/
validation.dart
l10n/
app_localizations.dart
ar.json
en.json
app.dart
main.dart
go_router
integrated for managing routes.- Handles Bottom Navigation Bar and nested routes effortlessly.
- Supports dynamic deep linking with
go_router
anduni_links
. - Cross-platform configuration for Android and iOS.
- Supports multiple languages using
intl
. - Dynamic language switching.
- Custom themes for UI components.
- Error handling and exception helpers.
- Device utilities for platform-specific checks.
git clone https://github.com/mahmoodhamdi/Tempelate.git
cd flutter-template
Run the following command to fetch all dependencies:
flutter pub get
- Update API constants in
lib/core/utils/constants/api_constants.dart
. - Add your project-specific configurations in
service_locator.dart
.
flutter run
- Define the route in
AppPages
- Add the corresponding screen widget.
Example:
GoRoute(
path: '/new-screen',
builder: (context, state) => NewScreen(),
),
- Create a new JSON file in
lib/l10n/
(e.g.,es.json
for Spanish). - Add translations in the JSON file.
- Update
supportedLocales
inlib/app.dart
supportedLocales: const [
Locale('en'),
Locale('ar'),
Locale('es'),
],
Keep dependencies up to date by running:
flutter pub upgrade
Feel free to open issues or submit pull requests to improve this template.
This project is licensed under the MIT License - see the LICENSE file for details.