-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
11 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
TODO: Add your license here. | ||
Copyright Β© Dimitri Dessus | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the βSoftwareβ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
The Software is provided βas isβ, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,58 @@ | ||
# live_activities | ||
<div align="center"> | ||
<img alt="flutter ios 16 live activities" /> | ||
</div> | ||
|
||
A new Flutter plugin project. | ||
# Live Activities | ||
|
||
## Getting Started | ||
A Flutter plugin to use iOS 16.1+ **Live Activities** & iPhone 14 Pro **Dynamic Island** features. | ||
|
||
This project is a starting point for a Flutter | ||
[plug-in package](https://flutter.dev/developing-packages/), | ||
a specialized package that includes platform-specific implementation code for | ||
Android and/or iOS. | ||
## π§ What is it ? | ||
|
||
For help getting started with Flutter development, view the | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
This plugin use [iOS ActivityKit API](https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities). | ||
|
||
**live_activities** can be used to show **dynamic live notification** & implement **dynamic island** feature on the iPhone 14 Pro / Max β«οΈ | ||
|
||
> β οΈ **live_activities** is only intended to use with **iOS 16.1+** ! | ||
> It will simply do nothing on other platform & < iOS 16.1 | ||
<div align="center"> | ||
<img alt="flutter ios 16 live activities logo" src="" /> | ||
</div> | ||
|
||
## π» Getting started | ||
|
||
- π± Create natively your Live Activity view [**tutorial**](https://levelup.gitconnected.com/how-to-create-live-activities-widget-for-ios-16-2c07889f1235) | ||
- β«οΈ (*Opt.*) Create natively a Dynamic Island [**tutorial**](https://medium.com/macoclock/how-to-create-dynamic-island-widgets-on-ios-16-1-or-above-dca0a7dd1483) | ||
|
||
- π Import the plugin. | ||
|
||
```dart | ||
import 'package:live_activities/live_activities.dart'; | ||
``` | ||
|
||
- π£ Create your dynamic activity. | ||
|
||
```dart | ||
final Map<String, String> activityModel = { | ||
'name': 'Margherita', | ||
'ingredient': 'tomato, mozzarella, basil', | ||
'quantity': '1', | ||
}; | ||
_liveActivitiesPlugin.createActivity(activityModel.toMap()); | ||
``` | ||
|
||
> β οΈ For now you can only pass a ```String```. | ||
## π Documentation | ||
|
||
| Name | Description | Returned value | | ||
| ---- | ----------- | -------- | | ||
| ```.createActivity()``` | Create an iOS live activity, | ```String``` The activity identifier | | ||
| ```.updateActivity()``` | Update the live activity data by using the ```activityId``` provided | ```Future``` When the activity was updated | | ||
| ```.endActivity()``` | End the live activity by using the ```activityId``` provided | ```Future``` When the activity was ended | | ||
|
||
## π― Roadmap | ||
|
||
- [ ] Support multiple type instead of ```String``` (Date, Number etc.). | ||
- [ ] Inject a Widget inside the notification with Flutter Engine ? |