diff --git a/packages/stream_chat_flutter_core/example/lib/main.dart b/packages/stream_chat_flutter_core/example/lib/main.dart index 11655b66..496f7c82 100644 --- a/packages/stream_chat_flutter_core/example/lib/main.dart +++ b/packages/stream_chat_flutter_core/example/lib/main.dart @@ -4,6 +4,7 @@ void main() { runApp(MyApp()); } +// ignore: public_member_api_docs class MyApp extends StatelessWidget { // This widget is the root of your application. @override @@ -31,7 +32,9 @@ class MyApp extends StatelessWidget { } } +// ignore: public_member_api_docs class MyHomePage extends StatefulWidget { + // ignore: public_member_api_docs MyHomePage({Key key, this.title}) : super(key: key); // This widget is the home page of your application. It is stateful, meaning @@ -43,6 +46,7 @@ class MyHomePage extends StatefulWidget { // used by the build method of the State. Fields in a Widget subclass are // always marked "final". + // ignore: public_member_api_docs final String title; @override diff --git a/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart b/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart index 5b992470..41c6f81d 100644 --- a/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart @@ -261,6 +261,9 @@ class _ChannelListCoreState extends State /// Controller used for paginating data in [ChannelListCore] class ChannelListController { + /// Call this function to reload data VoidCallback loadData; + + /// Call this function to load further data VoidCallback paginateData; } diff --git a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart index 6ef92569..1cd5162e 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart @@ -68,6 +68,7 @@ class MessageListCore extends StatefulWidget { /// Use [ChannelListController.paginateData] pagination. final MessageListController messageListController; + /// Function called when messages are fetched final Widget Function(BuildContext, List) messageListBuilder; /// Function used to build a loading widget @@ -168,5 +169,6 @@ class _MessageListCoreState extends State { /// Controller used for paginating data in [ChannelListView] class MessageListController { + /// Call this function to load further data Function({QueryDirection direction}) paginateData; } diff --git a/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart b/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart index de0af711..e5ff9527 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart @@ -196,6 +196,9 @@ class _MessageSearchListCoreState extends State { /// Controller used for paginating data in [ChannelListView] class MessageSearchListController { + /// Call this function to reload data VoidCallback loadData; + + /// Call this function to load further data VoidCallback paginateData; } diff --git a/packages/stream_chat_flutter_core/lib/src/stream_channel.dart b/packages/stream_chat_flutter_core/lib/src/stream_channel.dart index 8b4b97ef..85f7ecca 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_channel.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_channel.dart @@ -4,12 +4,20 @@ import 'package:flutter/material.dart'; import 'package:rxdart/rxdart.dart'; import 'package:stream_chat/stream_chat.dart'; -enum QueryDirection { top, bottom } +/// Specifies query direction for pagination +enum QueryDirection { + /// Query earlier messages + top, + + /// Query later messages + bottom, +} /// Widget used to provide information about the channel to the widget tree /// /// Use [StreamChannel.of] to get the current [StreamChannelState] instance. class StreamChannel extends StatefulWidget { + // ignore: public_member_api_docs const StreamChannel({ Key key, @required this.child, @@ -20,8 +28,13 @@ class StreamChannel extends StatefulWidget { assert(channel != null), super(key: key); + // ignore: public_member_api_docs final Widget child; + + /// [channel] specifies the channel with which child should be wrapped final Channel channel; + + /// Shows a loading indicator final bool showLoading; /// If passed the channel will load from this particular message. @@ -45,6 +58,7 @@ class StreamChannel extends StatefulWidget { StreamChannelState createState() => StreamChannelState(); } +// ignore: public_member_api_docs class StreamChannelState extends State { /// Current channel Channel get channel => widget.channel; diff --git a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart index e8312638..b04542fc 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart @@ -26,9 +26,12 @@ import 'package:stream_chat/stream_chat.dart'; /// /// Use [StreamChatCore.of] to get the current [StreamChatCoreState] instance. class StreamChatCore extends StatefulWidget { + // ignore: public_member_api_docs final Client client; + // ignore: public_member_api_docs final Widget child; + // ignore: public_member_api_docs StreamChatCore({ Key key, @required this.client, @@ -58,6 +61,7 @@ class StreamChatCore extends StatefulWidget { /// The current state of the StreamChat widget class StreamChatCoreState extends State with WidgetsBindingObserver { + // ignore: public_member_api_docs Client get client => widget.client; Timer _disconnectTimer; diff --git a/packages/stream_chat_flutter_core/lib/src/user_list_core.dart b/packages/stream_chat_flutter_core/lib/src/user_list_core.dart index d08e06ae..e323591f 100644 --- a/packages/stream_chat_flutter_core/lib/src/user_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/user_list_core.dart @@ -249,7 +249,9 @@ class _UserListCoreState extends State } } +// ignore: public_member_api_docs abstract class ListItem { + // ignore: public_member_api_docs String get key { if (this is ListHeaderItem) { final header = (this as ListHeaderItem).heading; @@ -262,6 +264,7 @@ abstract class ListItem { return null; } + // ignore: public_member_api_docs Widget when({ @required Widget Function(String heading) headerItem, @required Widget Function(User user) userItem, @@ -276,20 +279,29 @@ abstract class ListItem { } } +// ignore: public_member_api_docs class ListHeaderItem extends ListItem { + // ignore: public_member_api_docs final String heading; + // ignore: public_member_api_docs ListHeaderItem(this.heading); } +// ignore: public_member_api_docs class ListUserItem extends ListItem { + // ignore: public_member_api_docs final User user; + // ignore: public_member_api_docs ListUserItem(this.user); } /// Controller used for paginating data in [ChannelListView] class UserListController { + /// Call this function to reload data VoidCallback loadData; + + /// Call this function to load further data VoidCallback paginateData; }