Azkary is a comprehensive Flutter-based application designed to enhance the spiritual experience of users by providing features such as prayer times, azkar, and a user-friendly interface. With a focus on usability and aesthetics, Azkary integrates customizable themes and notification settings to offer a personalized experience for all users.
- Features
- Getting Started
- Installation
- Usage
- Setup Awesome Notifications
- API for Prayer Times
- Folder Structure
- Contributing
- License
- Contact
- User Authentication: Secure login and registration to manage user accounts.
- Prayer Times: Display accurate prayer times based on the user's location.
- Azkar Access: Quick access to daily prayers and the ability to manage reminders.
- Customizable Themes: Light and dark themes to enhance user experience.
- Local Storage: Persistent storage of user preferences using Shared Preferences.
- Notification System: Utilize Awesome Notifications for timely reminders and alerts.
To run the Azkary app locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/azkary_app.git
-
Navigate to the Project Directory:
cd azkary_app
-
Install Required Dependencies:
flutter pub get
-
Run the Application:
flutter run
Ensure you have the Flutter SDK installed on your machine, along with a compatible IDE (such as Android Studio or Visual Studio Code). Follow the installation guide provided by Flutter for a comprehensive setup.
Upon launching the application, users will find an intuitive interface with a bottom navigation bar for seamless navigation among different sections:
- Home Screen: View prayer times and relevant religious information.
- Azkar Screen: Access daily prayers and manage notification settings.
- Sabha Screen: Keep track of tasbeeh counters.
- Settings Screen: Customize themes and configure application settings.
To set up Awesome Notifications in your Flutter project, follow these steps:
-
Add Dependency: Open your
pubspec.yaml
file and add the Awesome Notifications package:dependencies: awesome_notifications: ^0.0.0 # Replace with the latest version
-
Initialize Notifications: Ensure you initialize Awesome Notifications in your
main.dart
file:void main() async { WidgetsFlutterBinding.ensureInitialized(); await AwesomeNotifications().initialize( 'resourceKey', [ NotificationChannel( channelKey: 'basic_channel', channelName: 'Basic notifications', channelDescription: 'Notification channel for basic tests', defaultColor: Color(0xFF9D50b6), ledColor: Colors.white, ) ], ); runApp(MyApp()); }
-
Request Permissions: Ensure you request the necessary permissions for notifications:
AwesomeNotifications().createNotification( content: NotificationContent( channelKey: 'basic_channel', title: 'Hello Awesome Notifications!', body: 'This is a notification example.', ), );
-
Use Notifications: Utilize the notification manager to send reminders for azkar and prayer times.
To fetch prayer times from an external API, follow these steps:
-
Add HTTP Package: Add the HTTP package to your
pubspec.yaml
file:dependencies: http: ^0.13.3 # Replace with the latest version
-
API Implementation: Create a service class to handle API calls. Below is an example of fetching prayer times:
import 'package:http/http.dart' as http; import 'dart:convert'; class PrayerTimeService { static const String apiUrl = 'https://api.aladhan.com/v1/timings'; Future<Map<String, dynamic>> fetchPrayerTimes(double latitude, double longitude) async { final response = await http.get(Uri.parse('$apiUrl?latitude=$latitude&longitude=$longitude')); if (response.statusCode == 200) { return json.decode(response.body); } else { throw Exception('Failed to load prayer times'); } } }
-
Use the Service: Call this service in your
PrayerTimesCubit
or wherever you handle state management to retrieve and display prayer times.
The Azkary app includes a theming mode that allows users to switch between light and dark themes. The implementation utilizes the ThemeCubit
class for managing theme states.
-
ThemeCubit Class: The
ThemeCubit
manages the theme mode using the BLoC pattern. It saves the user's theme preference using Shared Preferences.import 'package:azkary_app/core/local_storage/shared_preferences_manager.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; enum AppTheme { light, dark } class ThemeCubit extends Cubit<ThemeMode> { static const String _themeKey = "theme_mode"; ThemeCubit() : super(ThemeMode.light); Future<void> loadTheme() async { final themeIndex = await SharedPreferencesManager.getData(key: _themeKey); if (themeIndex != null) { emit(ThemeMode.values[themeIndex]); } else { emit(ThemeMode.light); } } Future<void> toggleTheme(AppTheme theme) async { if (theme == AppTheme.dark) { emit(ThemeMode.dark); await SharedPreferencesManager.setData( key: _themeKey, value: ThemeMode.dark.index, ); } else { emit(ThemeMode.light); await SharedPreferencesManager.setData( key: _themeKey, value: ThemeMode.light.index, ); } } }
-
Load and Toggle Theme: Integrate the
loadTheme
andtoggleTheme
methods in your settings screen to allow users to switch themes. -
Update UI: Use the
BlocBuilder
to rebuild the UI based on the current theme mode.
The project is organized as follows:
azkary_app/
├── lib/
│ ├── core/
│ │ ├── local_storage/
│ │ ├── notification_helper/
│ │ └── theming/
│ ├── features/
│ │ ├── azkar/
│ │ ├── home/
│ │ ├── sabha/
│ │ └── settings/
│ └── main.dart
└── assets/
Contributions are highly encouraged! If you would like to contribute to فَاذْكُرُونِي أَذْكُرْكُمْ
, please follow these steps:
- Fork the Repository.
- Create a New Branch:
git checkout -b feature/YourFeature
- Commit Your Changes:
git commit -m "Add your message"
- Push to the Branch:
git push origin feature/YourFeature
- Open a Pull Request.
You’ve successfully integrated "فَاذْكُرُونِي أَذْكُرْكُمْ"
App into your Flutter app! For more advanced features and customization options.
If you found this guide helpful, don’t forget to ⭐ star this repository on GitHub to show your support!
Thank you for reading!
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or inquiries, feel free to reach out:
- GitHub: mohamedmagdy2301
- Email: [email protected]