| # | Feature | Description |
|---|---|---|
| 1 | Anonymous Authentication | Implemented using Firebase Auth for easy sign-in without credentials. |
| 2 | User Profile Form | User can enter and save their name and weight to Firestore. |
| 3 | Real-Time Step Tracking | The app tracks footsteps live while in the foreground. |
| 4 | Firestore Integration | Steps and weights are stored and updated in real time. |
| 5 | Weights List | Displays all weight entries alphabetically, ordered by latest date. |
| 6 | Steps List | Displays all step entries hourly, ordered by latest date. |
| 7 | Edit & Delete Entries | Users can modify or remove previous weight records. |
| 8 | Sign-Out | Allows users to sign out from Firebase. |
| 9 | Real-Time UI Updates | Data updates automatically when Firestore changes. |
| 10 | Dark Mode | Full support for dark and light themes. |
| 11 | Bilingual Support | The app supports both English and Arabic, with RTL/LTR layout. |
| 12 | Background Tracking | Steps tracking continues in the background (bonus). |
| # | Feature | Reason |
|---|---|---|
| 1 | Profile Image Upload | Not implemented because Firebase Storage requires a billing-enabled account (credit card) to upload and store images. |
- Framework: Flutter
- Architecture: Clean Architecture (Data, Domain, Presentation layers)
- State Management: Flutter BLoC
- Dependency Injection: GetIt
- Backend: Firebase (Auth, Firestore)
- Local Storage: Flutter Secure Storage
- Sensors: Pedometer, Permission Handler
- Background Support: Flutter Background Service
This project follows a Feature-First Clean Architecture approach:
lib/
├── src/
│ ├── core/ # Shared components (utils, network, themes, widgets)
│ ├── features/ # Feature-specific modules
│ │ ├── auth/ # Authentication (Data, Domain, Presentation)
│ │ ├── profile/ # User Profile logic
│ │ ├── steps/ # Step tracking logic
│ │ └── weights/ # Weight tracking logic
│ ├── steps_tracker/ # Application logic (Main Page, App Logic)
│ └── main.dart # App entry point
Each feature is divided into:
- Data: Models, Datasources, Repositories Implementation.
- Domain: Entities, Repositories Interfaces, Usecases.
- Presentation: BLoCs, Pages, Widgets.
This project relies on Firebase for authentication and data storage. Since sensitive configuration files are not version-controlled, you must provide your own:
- Create a Firebase Project at the Firebase Console.
- Android:
- Register an Android app (package name:
com.example.steps_trackeror checkandroid/app/build.gradle). - Download
google-services.json. - Place it in
android/app/google-services.json.
- Register an Android app (package name:
- iOS:
- Register an iOS app (Bundle ID: check
ios/Runner.xcodeproj). - Download
GoogleService-Info.plist. - Place it in
ios/Runner/GoogleService-Info.plist.
- Register an iOS app (Bundle ID: check
- macOS:
- Register a macOS app (if needed).
- Place
GoogleService-Info.plistinmacos/Runner/GoogleService-Info.plist.
Note: Ensure you enable Authentication (Anonymous) and Cloud Firestore in your Firebase console.
The application uses the following Firestore schema. Ensure your security rules allow read/write access to these collections for authenticated users.
Stores user profile information.
- Document ID:
uid(from Firebase Authentication) - Fields:
name(String): User's display name.weight(Double): User's current weight in kg.photo(String): URL to profile photo (optional).created_at(Timestamp): Date of account creation.
Stores historical weight entries.
- Document ID: Auto-generated
- Fields:
weight(Double): Recorded weight value.time(Timestamp): Date and time of the entry.
Stores hourly step counts.
- Document ID: Format
YYYY-MM-DD-HH(e.g.,2023-12-25-14) - Fields:
steps_count(Int): Number of steps taken in that hour.time(Timestamp): Time associated with the step count.
-
Clone the repository:
git clone <repository-url> cd steps_tracker
-
Install dependencies:
flutter pub get
-
Check Permissions:
- Android: Ensure you grant "Physical Activity" permission when prompted.
- iOS: Ensure you check "Motion & Fitness" permissions in Info.plist (already configured, but requires simulator with motion support or real device).
-
Run the app:
flutter run
-
Run Tests:
flutter test