Back to Skills

flutter-local-notifications

verified

Set up local notifications in Flutter apps with scheduling, permissions, and foreground handling. Use when adding notifications to a Flutter app, implementing reminders, scheduling alerts, or setting up notification channels on Android/iOS.

View on GitHub

Marketplace

gbischof-skills

gwbischof/skills

Plugin

flutter-local-notifications

Repository

gwbischof/skills

flutter-local-notifications/skills/flutter-local-notifications/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/gwbischof/skills/blob/main/flutter-local-notifications/skills/flutter-local-notifications/SKILL.md -a claude-code --skill flutter-local-notifications

Installation paths:

Claude
.claude/skills/flutter-local-notifications/
Powered by add-skill CLI

Instructions

# Flutter Local Notifications

Add local notifications to Flutter apps with proper platform configuration, scheduling, and state management.

## Dependencies

Add to `pubspec.yaml`:
```yaml
flutter_local_notifications: ^18.0.0
timezone: ^0.9.4
```

## Android Configuration

### build.gradle.kts

Enable core library desugaring in `android/app/build.gradle.kts`:

```kotlin
android {
    compileOptions {
        isCoreLibraryDesugaringEnabled = true  // Required for flutter_local_notifications
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
}

dependencies {
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}
```

### AndroidManifest.xml

Add to `android/app/src/main/AndroidManifest.xml`:

**Permissions** (before `<application>`):
```xml
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
```

**Receivers** (inside `<application>`):
```xml
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
        <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
    </intent-filter>
</receiver>
```

## Implementation

### 1. Constants File

Create `lib/services/notifications/notification_constants.dart`:
- Notification IDs (base ID + offset pattern for multiple scheduled notifications)
- Channel ID, name, description (Android)
- SharedPreferences key for enabled state
- Schedule parameters (hour, minute, days ahead, probability if using random scheduling)
- Message temp

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6973 chars