fix: analysis issues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -261,6 +261,9 @@ class _ChannelListCoreState extends State<ChannelListCore>
|
||||
|
||||
/// 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;
|
||||
}
|
||||
|
||||
@@ -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<Message>) messageListBuilder;
|
||||
|
||||
/// Function used to build a loading widget
|
||||
@@ -168,5 +169,6 @@ class _MessageListCoreState extends State<MessageListCore> {
|
||||
|
||||
/// Controller used for paginating data in [ChannelListView]
|
||||
class MessageListController {
|
||||
/// Call this function to load further data
|
||||
Function({QueryDirection direction}) paginateData;
|
||||
}
|
||||
|
||||
@@ -196,6 +196,9 @@ class _MessageSearchListCoreState extends State<MessageSearchListCore> {
|
||||
|
||||
/// 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;
|
||||
}
|
||||
|
||||
@@ -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<StreamChannel> {
|
||||
/// Current channel
|
||||
Channel get channel => widget.channel;
|
||||
|
||||
@@ -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<StreamChatCore>
|
||||
with WidgetsBindingObserver {
|
||||
// ignore: public_member_api_docs
|
||||
Client get client => widget.client;
|
||||
Timer _disconnectTimer;
|
||||
|
||||
|
||||
@@ -249,7 +249,9 @@ class _UserListCoreState extends State<UserListCore>
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user