Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from ably/move-classes-into-files
Refactoring: Move classes into separate files
- Loading branch information
Showing
13 changed files
with
66 additions
and
55 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'dart:async'; | ||
|
||
import '../../../message/message.dart'; | ||
|
||
/// An item for used to enqueue a message to be published after an ongoing | ||
/// authCallback is completed | ||
class PublishQueueItem { | ||
final List<Message> messages; | ||
final Completer<void> completer; | ||
|
||
PublishQueueItem(this.completer, this.messages); | ||
} |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import '../../rest/rest.dart'; | ||
import '../realtime.dart'; | ||
|
||
/// options provided when instantiating a realtime channel | ||
/// | ||
/// https://docs.ably.com/client-lib-development-guide/features/#TB1 | ||
class RealtimeChannelOptions extends RestChannelOptions { | ||
/// https://docs.ably.com/client-lib-development-guide/features/#TB2c | ||
final Map<String, String>? params; | ||
|
||
/// https://docs.ably.com/client-lib-development-guide/features/#TB2d | ||
final List<ChannelMode>? modes; | ||
|
||
/// create channel options with a cipher, params and modes | ||
RealtimeChannelOptions(Object cipher, {this.params, this.modes}) | ||
: super(cipher); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:ably_flutter/src/common/common.dart'; | ||
import 'package:ably_flutter/src/realtime/realtime.dart'; | ||
|
||
/// A collection of realtime channel objects | ||
/// | ||
/// https://docs.ably.com/client-lib-development-guide/features/#RTS1 | ||
abstract class RealtimeChannelsInterface<T extends RealtimeChannelInterface> | ||
extends Channels<T> { | ||
/// instance of ably realtime client | ||
RealtimeInterface realtime; | ||
|
||
/// instantiates with the ably [RealtimeInterface] instance | ||
RealtimeChannelsInterface(this.realtime); | ||
} |
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,6 +1,6 @@ | ||
export 'src/channel_options.dart'; | ||
export 'src/channels.dart'; | ||
export 'src/presence.dart'; | ||
export 'src/rest.dart'; | ||
export 'src/rest_channel_options.dart'; | ||
export 'src/rest_history_params.dart'; | ||
export 'src/rest_presence_params.dart'; |
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
4 changes: 2 additions & 2 deletions
4
lib/src/rest/src/channel_options.dart → lib/src/rest/src/rest_channel_options.dart
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,10 +1,10 @@ | ||
/// options provided when instantiating a channel | ||
/// | ||
/// https://docs.ably.com/client-lib-development-guide/features/#TB1 | ||
class ChannelOptions { | ||
class RestChannelOptions { | ||
/// https://docs.ably.com/client-lib-development-guide/features/#TB2b | ||
final Object cipher; | ||
|
||
/// create channel options with a cipher | ||
ChannelOptions(this.cipher); | ||
RestChannelOptions(this.cipher); | ||
} |