A comprehensive Flutter application demonstrating iOS Live Activities integration with Dynamic Island support and Method Channels communication. This project showcases real-time delivery tracking with seamless iOS native integration.
- Live Activities Integration: Real-time delivery progress updates on iOS Lock Screen
- Dynamic Island Support: Interactive content in the iPhone 14 Pro+ Dynamic Island
- Method Channels Communication: Bidirectional Flutter-iOS native communication
- Real-time Updates: Progress tracking with live data synchronization
- Clean Architecture: Well-structured codebase with proper separation of concerns
- Professional UI: Modern Flutter interface with smooth animations
The app simulates a delivery tracking system with:
- Progress bar showing delivery completion percentage
- Real-time countdown timer (ETA)
- Start/Stop Live Activity controls
- Dynamic Island compact, expanded, and minimal views
- Lock screen notifications with live updates
- iOS: 16.1+ (for Live Activities support)
- Device: Physical iPhone (Live Activities don't work in Simulator)
- Dynamic Island: iPhone 14 Pro/Pro Max or newer (for Dynamic Island features)
- Development:
- Xcode 15+
- Flutter 3.5+
- Dart SDK 3.5+
lib/
├── main.dart # Main app with delivery demo UI
├── model/
│ └── delivery.dart # Delivery data model
└── service/
└── delivery_service.dart # Method channel service layer
ios/
├── Runner/
│ └── AppDelegate.swift # Method channel handlers & Live Activity management
└── DeliveryLiveActivityE/ # Widget Extension Target
├── DeliveryLiveActivityE.swift # Widget configuration
├── DeliveryLiveActivityELiveActivity.swift # Live Activity UI definitions
└── DeliveryLiveActivityEBundle.swift # Widget bundle
class Delivery {
int minutesToDelivery;
int progress;
Map<String, dynamic> toJson() => {
'minutesToDelivery': minutesToDelivery,
'progress': progress,
};
}- Method Channel:
com.example.ios_dybamic_island_flutter - Methods:
startNotifications: Initialize Live ActivityupdateNotifications: Update progress in real-timefinishDeliveryNotification: Complete deliveryendNotifications: Cancel Live Activity
- Progress tracking with animated linear progress indicator
- Timer-based updates (1-second intervals)
- Start/Stop Live Activity controls
- Real-time ETA display
- ActivityKit Framework: iOS 16.1+ Live Activities support
- Method Channel Handler: Processes Flutter method calls
- Activity Management: Start, update, and end Live Activities
- Error Handling: Comprehensive error management
struct ContentState: Codable, Hashable {
var progress: Double // Delivery progress (0-100)
var minutesToDelivery: Int // ETA in minutes
}- Compact Leading: "ETA" label
- Compact Trailing: Progress percentage
- Minimal View: Minutes remaining
- Expanded View:
- Leading region: "Leading" text
- Trailing region: "Trailing" text
- Bottom region: Full progress and ETA details
- Delivery progress percentage and ETA
- Cyan background with black text
- System action foreground color customization
git clone <repository-url>
cd ios_dybamic_island_flutter
flutter pub getThe Widget Extension target DeliveryLiveActivityE is already configured with:
- Bundle ID: Properly set for App Store distribution
- Deployment Target: iOS 16.1+
- Capabilities: Live Activities enabled
- Info.plist: Widget extension configuration
# Open iOS project
open ios/Runner.xcworkspace
# Run on physical device (required for Live Activities)
flutter run --debug- Launch App: Open on a physical iPhone with iOS 16.1+
- Start Activity: Tap "Start Live Activity" button
- Monitor Progress:
- Watch the in-app progress bar
- Check Dynamic Island (iPhone 14 Pro+)
- View Lock Screen notification
- Real-time Updates: Progress updates every second
- Complete/Cancel: Use "End Live Activity" to stop
- Progress Indicator: Animated linear progress bar
- ETA Display: Real-time countdown
- Control Buttons: Start/Stop with icons
- Material Design: Modern UI with proper theming
- Minimal: Shows minutes remaining (e.g., "5mins")
- Compact: ETA label + progress percentage
- Expanded: Full delivery details with regions
- Progress percentage and ETA
- Consistent branding with app theme
- Clear, readable information display
| Method | Parameters | Description |
|---|---|---|
startNotifications |
{progress: Double, minutesToDelivery: Int} |
Initialize Live Activity |
updateNotifications |
{progress: Double, minutesToDelivery: Int} |
Update activity state |
finishDeliveryNotification |
None | Complete delivery |
endNotifications |
None | Cancel activity |
- Platform exception catching
- Invalid argument validation
- Activity authorization checks
- Graceful failure management
- Physical Device: Required for Live Activities
- iOS Version: Verify iOS 16.1+ compatibility
- Permissions: Check Live Activities are enabled in Settings
- Background: Test updates when app is backgrounded
- Device: Requires iPhone 14 Pro/Pro Max or newer
- States: Test minimal, compact, and expanded views
- Interactions: Verify tap actions work correctly
main.dart: Demo app with timer-based progress simulationdelivery.dart: Simple data model with JSON serializationdelivery_service.dart: Method channel abstraction layer
AppDelegate.swift: Method channel handling and Activity lifecycleDeliveryLiveActivityELiveActivity.swift: Dynamic Island and Lock Screen UIDeliveryLiveActivityE.swift: Widget timeline providerDeliveryLiveActivityEBundle.swift: Widget bundle configuration
- Physical Device Required: Live Activities cannot be tested in iOS Simulator
- iOS Version: Minimum iOS 16.1 required for Live Activities
- Dynamic Island: Only available on iPhone 14 Pro models and newer
- Permissions: Users must grant Live Activities permission
- Background Updates: Activities can update even when app is closed
- Battery Impact: Live Activities are optimized for minimal battery usage
- Fork the repository
- Create a feature branch
- Make your changes
- Test on physical iOS device
- Submit a pull request
This project is available under the MIT License. See LICENSE file for details.
Created with ❤️ by Kudus Rufai
Note: This implementation serves as a foundation for integrating Live Activities in Flutter apps. Customize the UI, data models, and update frequencies according to your specific use case.




