Pin a channel
Pin channels to the top of the channel list using the pin / unpin methods on BaseChannel instances. The pinned state is reflected in the isPinned property.
Pin a channel
Pin a channel to the top of the list. The pinned state syncs to the server and persists across devices. This is a BaseChannel instance method.
Method
Dart
Future<int> pin(PinParams params, ErrorHandler handler);
Parameters
| Parameter | Type | Description |
|---|---|---|
| params | PinParams | Pin parameters |
| handler | ErrorHandler | Result callback |
PinParams properties
| Property | Type | Description |
|---|---|---|
updateOperationTime | bool | Whether to update the channel's operation timestamp |
Code example
Dart
BaseChannel channel = ...;
int? ret = await channel.pin(
PinParams(updateOperationTime: true),
(NCError? error) {
if (error?.isSuccess == true) {
print('Channel pinned');
}
},
);
Unpin a channel
Method
Dart
Future<int> unpin(ErrorHandler handler);