Skip to content

Instantly share code, notes, and snippets.

@amlsampath
Created June 15, 2025 09:10
Show Gist options
  • Select an option

  • Save amlsampath/997903326b96878016046a8e97e59736 to your computer and use it in GitHub Desktop.

Select an option

Save amlsampath/997903326b96878016046a8e97e59736 to your computer and use it in GitHub Desktop.

Create a Flutter mobile app for managing tasks (To-Do List) with Google AdMob integration.

📌 Core Features:

  • Add, edit, and delete tasks
  • Each task should include the following properties:
    • title: String
    • description: String
    • priority: Enum (Low, Medium, High)
    • dueDate: DateTime
    • status: Enum (Pending, Completed)
  • Display tasks in a scrollable list
  • Highlight tasks using different colors or icons based on priority (e.g., red for high, yellow for medium, green for low)

🧠 Architecture:

  • Use a feature-based folder structure
  • Follow clean architecture principles
  • Use Bloc for state management (flutter_bloc package)
  • Keep UI, business logic, and data access well-separated

🗂 Suggested Folder Structure: lib/
├── main.dart
├── core/
│ └── utils/ # Utility classes, enums, extensions
├── features/
│ └── tasks/
│ ├── models/ # Task model and enums
│ ├── services/ # TaskService using SharedPreferences
│ ├── bloc/ # Bloc, events, states
│ ├── widgets/ # TaskTile widget
│ └── screens/ # TaskListScreen with UI

💾 Local Storage:

  • Use SharedPreferences to persist tasks locally on the device
  • Save tasks as a JSON list
  • Provide functions to load, save, and delete tasks using SharedPreferences

💰 AdMob Integration:

  • Use the google_mobile_ads package
  • Initialize MobileAds.instance.initialize() in main.dart
  • Integrate the following ad types:
    • Banner Ad at the bottom of the Task List screen
    • Interstitial Ad after adding or deleting a task (show after confirmation)
  • Use test ad unit IDs for both banner and interstitial during development

🎨 UI Requirements:

  • Use Material Design
  • Floating Action Button (FAB) to add new tasks
  • Bottom sheet or dialog for editing/adding tasks
  • Show due date and priority icon next to each task
  • Checkbox or toggle to mark a task as completed

⚠️ Notes:

  • Use Flutter 3+
  • No Firebase or cloud functionality
  • No user authentication needed
  • Prioritize clean, modular, reusable code

🎯 Goal: The app should demonstrate a practical task management system along with real-world AdMob ad placement for monetization examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment