add docs
This commit is contained in:
@@ -44,7 +44,7 @@ linter:
|
||||
- package_prefixed_library_names
|
||||
- prefer_is_not_empty
|
||||
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
|
||||
# - public_member_api_docs
|
||||
- public_member_api_docs
|
||||
- slash_for_doc_comments
|
||||
# - sort_constructors_first
|
||||
# - sort_unnamed_constructors_first
|
||||
|
||||
@@ -23,7 +23,7 @@ Future<void> _handleAndroidNotification(
|
||||
body: notificationData.message.text,
|
||||
);
|
||||
|
||||
await NotificationService.sendNotification(androidNotificationOptions);
|
||||
await NotificationService.showNotification(androidNotificationOptions);
|
||||
}
|
||||
|
||||
void main() async {
|
||||
|
||||
@@ -43,6 +43,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
||||
/// Modify it to change the widget appearance.
|
||||
class ChannelImage extends StatelessWidget {
|
||||
/// Instantiate a new ChannelImage
|
||||
const ChannelImage({
|
||||
Key key,
|
||||
this.channel,
|
||||
|
||||
@@ -47,6 +47,7 @@ typedef ChannelPreviewBuilder = Widget Function(BuildContext, Channel);
|
||||
/// The widget components render the ui based on the first ancestor of type [StreamChatTheme].
|
||||
/// Modify it to change the widget appearance.
|
||||
class ChannelListView extends StatefulWidget {
|
||||
/// Instantiate a new ChannelListView
|
||||
ChannelListView({
|
||||
Key key,
|
||||
this.filter,
|
||||
@@ -59,6 +60,7 @@ class ChannelListView extends StatefulWidget {
|
||||
this.errorBuilder,
|
||||
}) : super(key: key);
|
||||
|
||||
/// The builder that will be used in case of error
|
||||
final Widget Function(Error error) errorBuilder;
|
||||
|
||||
/// The query filters to use.
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'stream_channel.dart';
|
||||
///
|
||||
/// The widget uses a [StreamBuilder] to render the channel information image as soon as it updates.
|
||||
class ChannelName extends StatelessWidget {
|
||||
/// Instantiate a new ChannelName
|
||||
const ChannelName({
|
||||
Key key,
|
||||
this.channel,
|
||||
|
||||
@@ -25,6 +25,7 @@ class ChannelPreview extends StatelessWidget {
|
||||
/// Channel displayed
|
||||
final Channel channel;
|
||||
|
||||
/// Instantiate a new ChannelPreview
|
||||
ChannelPreview({
|
||||
@required this.channel,
|
||||
Key key,
|
||||
|
||||
@@ -5,9 +5,12 @@ import 'package:rxdart/rxdart.dart';
|
||||
import 'package:stream_chat/stream_chat.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat.dart';
|
||||
|
||||
/// Widget dedicated to the management of a channel list with pagination
|
||||
class ChannelsBloc extends StatefulWidget {
|
||||
/// The widget child
|
||||
final Widget child;
|
||||
|
||||
/// Instantiate a new ChannelsBloc
|
||||
const ChannelsBloc({
|
||||
Key key,
|
||||
this.child,
|
||||
@@ -16,6 +19,7 @@ class ChannelsBloc extends StatefulWidget {
|
||||
@override
|
||||
ChannelsBlocState createState() => ChannelsBlocState();
|
||||
|
||||
/// Use this method to get the current [ChannelsBlocState] instance
|
||||
static ChannelsBlocState of(BuildContext context) {
|
||||
ChannelsBlocState streamChatState;
|
||||
|
||||
@@ -29,6 +33,7 @@ class ChannelsBloc extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// The current state of the [ChannelsBloc]
|
||||
class ChannelsBlocState extends State<ChannelsBloc>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
@override
|
||||
|
||||
@@ -2,9 +2,12 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
/// A full screen image widget
|
||||
class FullScreenImage extends StatelessWidget {
|
||||
/// The url of the image
|
||||
final String url;
|
||||
|
||||
/// Instantiate a new FullScreenImage
|
||||
const FullScreenImage({
|
||||
Key key,
|
||||
@required this.url,
|
||||
|
||||
@@ -56,13 +56,14 @@ import 'stream_channel.dart';
|
||||
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
||||
/// Modify it to change the widget appearance.
|
||||
class MessageInput extends StatefulWidget {
|
||||
MessageInput(
|
||||
{Key key,
|
||||
this.onMessageSent,
|
||||
this.parentMessage,
|
||||
this.editMessage,
|
||||
this.maxHeight = 150})
|
||||
: super(key: key);
|
||||
/// Instantiate a new MessageInput
|
||||
MessageInput({
|
||||
Key key,
|
||||
this.onMessageSent,
|
||||
this.parentMessage,
|
||||
this.editMessage,
|
||||
this.maxHeight = 150,
|
||||
}) : super(key: key);
|
||||
|
||||
/// Message to edit
|
||||
final Message editMessage;
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef ThreadTapCallback = void Function(Message, Widget);
|
||||
/// The widget components render the ui based on the first ancestor of type [StreamChatTheme].
|
||||
/// Modify it to change the widget appearance.
|
||||
class MessageListView extends StatefulWidget {
|
||||
/// Instantiate a new MessageListView
|
||||
MessageListView({
|
||||
Key key,
|
||||
this.messageBuilder,
|
||||
|
||||
@@ -32,6 +32,7 @@ import 'stream_chat.dart';
|
||||
/// The widget components render the ui based on the first ancestor of type [StreamChatTheme].
|
||||
/// Modify it to change the widget appearance.
|
||||
class MessageWidget extends StatefulWidget {
|
||||
/// Instantiate a new MessageWidget
|
||||
const MessageWidget({
|
||||
Key key,
|
||||
@required this.previousMessage,
|
||||
|
||||
@@ -67,11 +67,13 @@ class ReactionPicker extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// Add a reaction to the message
|
||||
void sendReaction(BuildContext context, String reactionType) {
|
||||
channel.sendReaction(message.id, reactionType);
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
/// Remove a reaction from the message
|
||||
void removeReaction(BuildContext context, String reactionType) {
|
||||
channel.deleteReaction(message.id, reactionType);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -101,6 +101,7 @@ class StreamChannelState extends State<StreamChannel> {
|
||||
});
|
||||
}
|
||||
|
||||
/// Query the channel members and watchers
|
||||
Future<void> queryMembersAndWatchers() async {
|
||||
await widget.channel.query(
|
||||
membersPagination: PaginationParams(
|
||||
|
||||
@@ -59,6 +59,7 @@ class StreamChat extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// The current state of the StreamChat widget
|
||||
class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
|
||||
Client get client => widget.client;
|
||||
final GlobalKey<NavigatorState> _navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
@@ -62,6 +62,7 @@ class ThreadHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
/// The message parent of this thread
|
||||
final Message parent;
|
||||
|
||||
/// Instantiate a new ThreadHeader
|
||||
ThreadHeader({
|
||||
Key key,
|
||||
@required this.parent,
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:stream_chat_flutter/src/stream_channel.dart';
|
||||
|
||||
/// Widget to show the current list of typing users
|
||||
class TypingIndicator extends StatelessWidget {
|
||||
/// Instantiate a new TypingIndicator
|
||||
const TypingIndicator({
|
||||
Key key,
|
||||
this.channel,
|
||||
|
||||
Reference in New Issue
Block a user