📱 Aethel Application

Complete Developer & Deployment Documentation

📋 Application Overview

What is Aethel?

Aethel is a modern, feature-rich task management application built with Flutter. It provides smart organization, premium features, and multi-language support with a beautiful, responsive UI.

Key Features

✅ Task Management

Create, organize, and track tasks with smart categorization and energy levels

🌍 Multi-Language

Full RTL/LTR support for Arabic, English, French, and Spanish

💎 Premium Features

In-app subscriptions with monthly, quarterly, and yearly plans

📊 Activity Tracking

Monitor productivity with detailed statistics and insights

🔒 Security

Biometric authentication and app lock features

💰 Monetization

Google AdMob integration with banner and interstitial ads

Technical Stack

Technology Version Purpose
Flutter SDK 3.9.2+ Cross-platform framework
Dart 3.9.2+ Programming language
Riverpod 3.0.3 State management
Hive 2.2.3 Local database
Google Mobile Ads 7.0.0 Ad monetization
In-App Purchase 3.2.3 Subscription management

🏗️ Application Architecture

Project Structure

aethel/
├── android/                    # Android platform code
│   ├── app/
│   │   ├── build.gradle.kts   # Build configuration
│   │   └── src/main/
│   │       └── AndroidManifest.xml
│   └── key.properties         # Signing keys (not in git)
├── ios/                       # iOS platform code
├── lib/                       # Flutter application code
│   ├── l10n/                  # Localization files
│   ├── main.dart              # App entry point
│   └── src/
│       ├── core/              # Core functionality
│       │   ├── theme/         # App theming
│       │   ├── localization/  # Language support
│       │   └── services/      # Core services
│       ├── features/          # Feature modules
│       │   ├── tasks/         # Task management
│       │   ├── premium/       # Subscription features
│       │   ├── ads/           # Advertisement
│       │   ├── settings/      # App settings
│       │   └── activity/      # Activity tracking
│       └── shared/            # Shared widgets
├── assets/                    # Application assets
│   └── icon/                  # App icons
├── pubspec.yaml              # Dependencies
└── flutter_launcher_icons.yaml

How the Application Works

1. Initialization Flow

  1. main.dart - Entry point that initializes Flutter
  2. Hive Database - Opens local storage for tasks and settings
  3. Services - Initializes ads, notifications, and tracking
  4. Splash Screen - Shows while loading (3 seconds minimum)
  5. Dashboard - Main screen with task list

2. State Management (Riverpod)

The app uses Riverpod for state management. Key providers include:

  • taskListProvider - Manages all tasks
  • subscriptionControllerProvider - Handles premium status
  • adsServiceProvider - Controls ad display
  • themeControllerProvider - Theme switching
  • languageControllerProvider - Language selection

3. Data Persistence

Uses Hive (NoSQL database) for local storage:

  • Tasks Box - Stores all user tasks
  • Settings Box - Stores preferences
  • Activity Box - Stores usage statistics

⚙️ Application Configuration

🚀 NEW: Centralized Configuration

We have centralized the most common settings in one file for your convenience.

To change App Name, Support Email, Website, Colors, Ad IDs, and Subscription IDs, simply edit:

📁 lib/core/config/app_config.dart
class AppConfig {
  static const String appName = 'My App';
  static const String supportEmail = 'support@myapp.com';
  // ... Ads and Subscription IDs are also here!
}

1. Change Application Name (System)

1. Change Application Name

Step 1: Update pubspec.yaml

📁 pubspec.yaml
name: aethel  # Change this to your app name (lowercase, no spaces)
description: "Your app description here"

Step 2: Update Android Manifest

📁 android/app/src/main/AndroidManifest.xml
<application
    android:label="Your App Name"  <!-- Change this -->
    android:icon="@mipmap/ic_launcher">

Step 3: Update iOS Info.plist

📁 ios/Runner/Info.plist
<key>CFBundleName</key>
<string>Your App Name</string>

2. Change Package Name (Application ID)

⚠️ Important: Changing the package name is critical for Google Play deployment. The current package is com.oubaali.aethel

Step 1: Update build.gradle.kts

📁 android/app/build.gradle.kts
android {
    namespace = "com.yourcompany.yourapp"  // Change this
    
    defaultConfig {
        applicationId = "com.yourcompany.yourapp"  // Change this
        minSdk = flutter.minSdkVersion
        targetSdk = 36
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }
}

Step 2: Update AndroidManifest.xml

No changes needed - it uses the applicationId from build.gradle

Step 3: Rename Package Directories

Rename the directory structure:

From: android/app/src/main/kotlin/com/oubaali/aethel/

To: android/app/src/main/kotlin/com/yourcompany/yourapp/

Step 4: Update MainActivity.kt

📁 android/app/src/main/kotlin/com/yourcompany/yourapp/MainActivity.kt
package com.yourcompany.yourapp  // Change this

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

3. Change Application Version

Update pubspec.yaml

📁 pubspec.yaml
version: 1.0.1+4
# Format: MAJOR.MINOR.PATCH+BUILD_NUMBER
# Example: 2.0.0+5
# - 2.0.0 = Version shown to users
# - 5 = Build number (must increase for each upload)

Version Number Rules:

  • Major - Breaking changes (1.0.0 → 2.0.0)
  • Minor - New features (1.0.0 → 1.1.0)
  • Patch - Bug fixes (1.0.0 → 1.0.1)
  • Build Number - Must increase for each Google Play upload

💰 Google AdMob Configuration

Current Ad Implementation

The app uses Google Mobile Ads SDK 7.0.0 with:

  • Banner Ads - Displayed on Dashboard and Drawer
  • Interstitial Ads - Shown every 5 task completions
  • Test Ads - Currently using Google's test ad units

Step 1: Create AdMob Account

  1. Go to https://admob.google.com
  2. Sign in with your Google account
  3. Click "Get Started" and complete registration
  4. Create a new app in AdMob console

Step 2: Get Your Ad Unit IDs

In AdMob Console:

  1. Select your app
  2. Go to "Ad units"
  3. Create ad units for:
    • Banner Ad
    • Interstitial Ad
  4. Copy the Ad Unit IDs (format: ca-app-pub-XXXXXXXXXXXXXXXX/YYYYYYYYYY)

Step 3: Update AndroidManifest.xml

📁 android/app/src/main/AndroidManifest.xml
<!-- Replace with YOUR AdMob App ID -->
<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY"/>
⚠️ Important: The App ID is different from Ad Unit IDs. Get it from AdMob Console → App Settings

Step 4: Update Ad Unit IDs in Code

📁 lib/core/config/app_config.dart

We have moved ad configuration to AppConfig for easier access.

class AppConfig {
  // Ads Configuration
  static const bool adsEnabled = true;

  // Android
  static const String adMobAppIdAndroid = 'ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY'; 
  static const String bannerAdUnitIdAndroid = 'ca-app-pub-XXXXXXXXXXXXXXXX/YYYYYYYYYY';
  static const String interstitialAdUnitIdAndroid = 'ca-app-pub-XXXXXXXXXXXXXXXX/AAAAAAAAAA';

  // iOS
  static const String adMobAppIdiOS = 'ca-app-pub-XXXXXXXXXXXXXXXX~ZZZZZZZZZZ';
  static const String bannerAdUnitIdiOS = 'ca-app-pub-XXXXXXXXXXXXXXXX/BBBBBBBBBB';
  static const String interstitialAdUnitIdiOS = 'ca-app-pub-XXXXXXXXXXXXXXXX/CCCCCCCCCC';
}

Step 5: Test Your Ads

Testing Checklist:

  1. Build and run the app
  2. Check if banner ads appear on Dashboard
  3. Complete 5 tasks to trigger interstitial ad
  4. Verify ads load without errors

Ad Display Logic

Ads are hidden for premium users:

  • Free users see all ads
  • Premium subscribers see no ads
  • Controlled by shouldShowAds property

💎 In-App Subscriptions Setup

Current Subscription Plans

Plan Product ID Duration
Monthly premium_monthly 1 month
Quarterly premium_quarterly 3 months
Yearly premium_yearly 12 months

Step 1: Configure Google Play Console

  1. Upload your app to Google Play Console (see Deployment section)
  2. Go to Monetize → Products → Subscriptions
  3. Click "Create subscription"

Step 2: Create Subscription Products

For each subscription plan, configure:

  • Product ID: Must match code (e.g., premium_monthly)
  • Name: Premium Monthly Subscription
  • Description: Access all premium features
  • Billing Period: 1 month / 3 months / 1 year
  • Price: Set your price (e.g., $4.99, $11.99, $39.99)

Step 3: Change Subscription Prices

Note: Prices are set in Google Play Console, NOT in the code. The app fetches prices automatically.

To change prices:

  1. Go to Google Play Console
  2. Navigate to Monetize → Subscriptions
  3. Select the subscription product
  4. Click "Edit" on the price
  5. Set new price and save
  6. Changes take effect immediately

Step 4: Update Product IDs

📁 lib/core/config/app_config.dart

Update the IDs to match your Google Play Console products:

class AppConfig {
  // Subscription Configuration
  static const String premiumMonthlyId = 'your_monthly_id';
  static const String premiumYearlyId = 'your_yearly_id';
}

Step 5: Link Payment Method with Google Play

For Automatic Payments via Google Play:

  1. Go to Google Play Console
  2. Select your app
  3. Navigate to Monetize → Payments profile
  4. Click "Set up payments profile"
  5. Enter your business information
  6. Add payment method (bank account for receiving payments)
  7. Verify your identity and tax information
  8. Wait for Google approval (can take 1-3 days)
⚠️ Requirements:
  • Valid business or personal Google Payments account
  • Bank account for receiving payments
  • Tax information (varies by country)
  • Identity verification documents

Testing Subscriptions

Test Purchases:

  1. Add test accounts in Google Play Console
  2. Go to Settings → License testing
  3. Add Gmail accounts for testing
  4. These accounts can make test purchases without being charged

🖼️ Changing Application Images

1. App Icon

Current Icon Location

📁 assets/icon/app_icon.png

Step 1: Prepare Your Icon

Icon Requirements:

  • Size: 1024x1024 pixels (minimum)
  • Format: PNG with transparency
  • Shape: Square (launcher will apply shape)
  • Content: Keep important content in center 80%

Step 2: Replace Icon File

  1. Replace assets/icon/app_icon.png with your new icon
  2. Keep the same filename or update flutter_launcher_icons.yaml

Step 3: Update flutter_launcher_icons.yaml

📁 flutter_launcher_icons.yaml
flutter_launcher_icons:
  android: true
  ios: true
  image_path: "assets/icon/app_icon.png"  # Your icon path
  adaptive_icon_background: "#ffffff"     # Background color
  adaptive_icon_foreground: "assets/icon/app_icon.png"

Step 4: Generate Icons

# Run this command in terminal
flutter pub get
flutter pub run flutter_launcher_icons

✅ Icons will be automatically generated for all required sizes on Android and iOS

2. Splash Screen

The app uses a custom splash screen widget. To modify:

📁 lib/src/features/splash/presentation/splash_screen.dart

You can:

  • Change background gradient colors
  • Add a logo image
  • Modify animation effects
  • Change loading indicator style

3. Other Images in App

To add more images to your app:

  1. Place images in assets/images/ folder
  2. Update pubspec.yaml:
    flutter:
      assets:
        - assets/icon/
        - assets/images/  # Add this line
  3. Use in code:
    Image.asset('assets/images/your_image.png')

🔒 Privacy Policy

We have included a ready-to-use Privacy Policy template for your app.

Using the Template

  1. Open
    📁 privacy_policy_template.md
    in the project root.
  2. Replace the placeholders:
    • [APP_NAME]
    • [DEVELOPER_NAME]
    • [SUPPORT_EMAIL]
    • [ADMOB_PUBLISHER_ID]
  3. Export as PDF or host it on a website (e.g., GitHub Pages) to use as your Play Store Privacy Policy URL.

🚀 Deployment to Google Play Store

Prerequisites

  • ✅ Google Play Developer Account ($25 one-time fee)
  • ✅ App signing key (keystore file)
  • ✅ All configurations completed
  • ✅ App tested thoroughly

Step 1: Create Signing Key

Generate Keystore

# Run in terminal (Windows)
keytool -genkey -v -keystore d:\app\aethel\android\upload-keystore.jks ^
-storetype JKS -keyalg RSA -keysize 2048 -validity 10000 ^
-alias upload

# You'll be asked for:
# - Keystore password (remember this!)
# - Key password (can be same as keystore)
# - Your name, organization, etc.
⚠️ CRITICAL: Keep your keystore file and passwords safe! If you lose them, you cannot update your app on Google Play.

Step 2: Configure Signing

Create key.properties

📁 android/key.properties
storePassword=your_keystore_password
keyPassword=your_key_password
keyAlias=upload
storeFile=upload-keystore.jks
⚠️ Security: Never commit key.properties to Git! It's already in .gitignore

Step 3: Build Release APK/AAB

Build App Bundle (Recommended)

# App Bundle is smaller and optimized for Google Play
flutter build appbundle --release

Build APK (Alternative)

# APK for direct distribution
flutter build apk --release

Output Locations:

  • App Bundle: build/app/outputs/bundle/release/app-release.aab
  • APK: build/app/outputs/flutter-apk/app-release.apk

Step 4: Upload to Google Play Console

  1. Create App:
  2. Set Up App:
    • Complete all required sections in Dashboard
    • Privacy Policy URL (required)
    • App category and content rating
    • Target audience
  3. Upload Release:
    • Go to Production → Releases
    • Click "Create new release"
    • Upload your .aab file
    • Add release notes
  4. Store Listing:
    • Add app description (short & full)
    • Upload screenshots (minimum 2)
    • Add feature graphic (1024x500)
    • Upload app icon (512x512)
  5. Submit for Review:
    • Review all sections
    • Click "Send for review"
    • Wait for approval (typically 1-3 days)

App Signing by Google Play

Recommended: Use Google Play App Signing

  • Google manages your app signing key
  • You upload with an upload key
  • More secure and allows key recovery
  • Enabled automatically for new apps

Update Existing App

  1. Increase version number in pubspec.yaml
  2. Build new release: flutter build appbundle --release
  3. Go to Production → Releases
  4. Create new release and upload .aab
  5. Submit for review

🔧 Common Issues & Solutions

Build Errors

Error: "Execution failed for task ':app:processReleaseResources'"

Cause: Resource conflicts or invalid AndroidManifest.xml

Solution:

# Clean build
flutter clean
flutter pub get
flutter build appbundle --release

Error: "Keystore file not found"

Cause: key.properties points to wrong location

Solution:

  • Verify keystore file exists at specified path
  • Use absolute path in key.properties
  • Check file permissions

Error: "Gradle build failed with exit code 1"

Cause: Various Gradle configuration issues

Solutions:

# Update Gradle wrapper
cd android
./gradlew wrapper --gradle-version=8.0

# Clear Gradle cache
./gradlew clean

# Rebuild
cd ..
flutter clean
flutter pub get
flutter build appbundle

Ad Issues

Ads not showing

Possible Causes & Solutions:

  • Test ads: Make sure you're using correct test ad unit IDs
  • AdMob App ID: Verify it's correctly set in AndroidManifest.xml
  • Internet: Check device has internet connection
  • Premium status: Ads hidden for premium users
  • Ad initialization: Check logs for initialization errors

Error: "Ad failed to load: 3"

Cause: No ad inventory available

Solution:

  • Normal for test ads occasionally
  • Try again after a few minutes
  • Verify ad unit IDs are correct

In-App Purchase Issues

Products not loading

Checklist:

  • ✅ App uploaded to Google Play (at least internal testing)
  • ✅ Subscription products created in Play Console
  • ✅ Product IDs match exactly (case-sensitive)
  • ✅ Products are "Active" in Play Console
  • ✅ App signed with same key as uploaded version
  • ✅ Test account added to license testers

Error: "BillingClient is not ready"

Solution:

  • Wait a few seconds after app launch
  • Check internet connection
  • Verify Google Play Services is updated
  • Clear Google Play Store cache

Version Issues

Error: "Version code X has already been used"

Cause: Build number not increased

Solution:

# In pubspec.yaml, increase build number
version: 1.0.1+4  # Change to 1.0.1+5 or higher

Runtime Errors

Error: "MissingPluginException"

Cause: Plugin not properly registered

Solution:

flutter clean
flutter pub get
# Rebuild the app completely

App crashes on startup

Debug steps:

  1. Check logs: flutter logs
  2. Run in debug mode: flutter run
  3. Check Hive initialization
  4. Verify all required permissions in AndroidManifest

Google Play Console Issues

Upload rejected: "You need to use a different package name"

Cause: Package name already used by another app

Solution: Change package name (see Configuration section)

App stuck in "Pending publication"

Possible reasons:

  • Review in progress (wait 1-3 days)
  • Missing required information
  • Policy violations detected
  • Check email for Google notifications

🛠️ Required Tools & Software

Essential Development Tools

Tool Version Download Link Purpose
Flutter SDK 3.9.2+ flutter.dev Framework for building the app
Android Studio Latest developer.android.com IDE and Android SDK
VS Code Latest code.visualstudio.com Lightweight code editor (optional)
Git Latest git-scm.com Version control
Java JDK 17 oracle.com Required for Android builds

Installation Guide

1. Install Flutter

  1. Download Flutter SDK from flutter.dev
  2. Extract to C:\src\flutter (Windows)
  3. Add to PATH: C:\src\flutter\bin
  4. Verify installation:
    flutter doctor

2. Install Android Studio

  1. Download from developer.android.com
  2. Install with default settings
  3. Open Android Studio
  4. Install Android SDK (API 36 recommended)
  5. Install Flutter and Dart plugins

3. Setup Android SDK

  1. Open Android Studio → Settings → Appearance & Behavior → System Settings → Android SDK
  2. Install:
    • Android SDK Platform 36
    • Android SDK Build-Tools
    • Android SDK Command-line Tools
  3. Accept licenses:
    flutter doctor --android-licenses

4. Verify Setup

flutter doctor -v

# Should show:
# ✓ Flutter (Channel stable, 3.x.x)
# ✓ Android toolchain
# ✓ Android Studio
# ✓ Connected device

VS Code Extensions (Optional)

  • Flutter - Official Flutter extension
  • Dart - Dart language support
  • Flutter Widget Snippets - Code snippets
  • Pubspec Assist - Dependency management

Useful Commands

Command Purpose
flutter doctor Check Flutter installation
flutter pub get Install dependencies
flutter clean Clean build files
flutter run Run app in debug mode
flutter build apk Build release APK
flutter build appbundle Build release App Bundle
flutter analyze Check code for issues
flutter logs View app logs

Online Resources

📚 Flutter Docs

flutter.dev/docs

🎮 Google Play Console

play.google.com/console

💰 AdMob

admob.google.com

📦 Pub.dev

pub.dev