Skip to content

Commit

Permalink
📝 Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
istornz committed Sep 5, 2024
1 parent 2b90209 commit eded0b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
# https://dart.dev/guides/language/analysis-options
3 changes: 2 additions & 1 deletion lib/live_activities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class LiveActivities {
/// Create an App Group inside "Runner" target & "Extension" in Xcode.
/// Be sure to set the *SAME* App Group in both targets.
/// [urlScheme] is optional and is the scheme sub-component of the URL.
/// [appGroupId] is the App Group identifier.
Future init({required String appGroupId, String? urlScheme}) {
_appGroupsImageService.appGroupId = appGroupId;
return LiveActivitiesPlatform.instance.init(
Expand Down Expand Up @@ -87,7 +88,7 @@ class LiveActivities {
}

/// Check if iOS 16.1+ live activities are enabled.
Future<bool> areActivitiesEnabled() async {
Future<bool> areActivitiesEnabled() {
return LiveActivitiesPlatform.instance.areActivitiesEnabled();
}

Expand Down
7 changes: 5 additions & 2 deletions lib/models/live_activity_image.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import 'dart:typed_data';

import 'package:flutter/services.dart';

/// Interface for images displayed on live activity widget / dynamic island.
/// The image can be loaded from an asset, an url or from memory.
abstract class LiveActivityImage {
/// You can use the ```resizeFactor``` to resize the image (1 is the original size).
num resizeFactor;

LiveActivityImage(
this.resizeFactor,
);

/// Load the image.
Future<Uint8List> loadImage();
}

/// Load an image from Flutter asset.
/// Image need to have small resolution to be displayed on live activity widget / dynamic island.
/// You can use the ```resizeFactor``` to resize the image (1 is the original size).
class LiveActivityImageFromAsset extends LiveActivityImage {
/// Path to the image asset.
final String path;

LiveActivityImageFromAsset(
Expand Down

0 comments on commit eded0b5

Please sign in to comment.