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