openSnaps method
Future<void>
openSnaps({
- required String userId,
- String? snapName,
- Iterable<
String> ? tags, - int? snapId,
- String? token,
- StorifyMeEditorType editorType = StorifyMeEditorType.snaps,
override
Opens StorifyMe Snaps with the specified parameters.
userId: The user ID associated with StorifyMe Snaps.
snapName: (Optional) The name of the snap.
tags: (Optional) An iterable of tags associated with the snap.
snapId: (Optional) ID of an existing snap to edit. When provided, the
editor loads that snap instead of creating a new one. Requires token.
token: (Optional) Auth token generated by the StorifyMe API for this user.
Required when snapId is provided.
editorType: (Optional) Type of the editor to open. Defaults to
StorifyMeEditorType.snaps.
Implementation
@override
Future<void> openSnaps({
required String userId,
String? snapName,
Iterable<String>? tags,
int? snapId,
String? token,
StorifyMeEditorType editorType = StorifyMeEditorType.snaps,
}) async {
final map = <String, dynamic>{};
map[Params.USER_ID] = userId;
map[Params.SNAP_NAME] = snapName;
map[Params.TAGS] = tags;
map[Params.EDITOR_TYPE] = editorType.value;
if (snapId != null) {
map[Params.SNAP_ID] = snapId;
}
if (token != null) {
map[Params.TOKEN] = token;
}
await methodChannel.invokeMethod<void>(Method.OPEN_SNAPS, map);
}