From f7d1e480c7eb94099fa73eccd5bcf21907a8c93b Mon Sep 17 00:00:00 2001 From: Neevash Ramdial Date: Fri, 29 Jan 2021 21:04:14 -0400 Subject: [PATCH] [Core] sort constructor first across package --- .../lib/src/channels_bloc.dart | 9 ------ .../lib/src/lazy_load_scroll_view.dart | 28 ++++++++++--------- .../lib/src/message_search_bloc.dart | 3 -- .../lib/src/stream_chat_core.dart | 7 ----- .../lib/src/users_bloc.dart | 7 ++--- 5 files changed, 18 insertions(+), 36 deletions(-) diff --git a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart index 1c30ad65..987e06f9 100644 --- a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart @@ -37,15 +37,6 @@ class ChannelsBloc extends StatefulWidget { /// Function used to evaluate if a channel should be added to the list when a message.new event is received final bool Function(Event) shouldAddChannel; - /// Instantiate a new ChannelsBloc - const ChannelsBloc({ - Key key, - this.child, - this.lockChannelsOrder = false, - this.channelsComparator, - this.shouldAddChannel, - }) : super(key: key); - @override ChannelsBlocState createState() => ChannelsBlocState(); diff --git a/packages/stream_chat_flutter_core/lib/src/lazy_load_scroll_view.dart b/packages/stream_chat_flutter_core/lib/src/lazy_load_scroll_view.dart index 0e118420..1ba9ca7b 100644 --- a/packages/stream_chat_flutter_core/lib/src/lazy_load_scroll_view.dart +++ b/packages/stream_chat_flutter_core/lib/src/lazy_load_scroll_view.dart @@ -6,6 +6,21 @@ enum _LoadingStatus { LOADING, STABLE } /// Wrapper around a [Scrollable] which triggers [onEndOfPage]/[onStartOfPage] the Scrollable /// reaches to the start or end of the view extent. class LazyLoadScrollView extends StatefulWidget { + /// Creates a new instance of [LazyLoadScrollView]. The parameter [child] must be + /// supplied and not null. + const LazyLoadScrollView({ + Key key, + @required this.child, + this.onStartOfPage, + this.onEndOfPage, + this.onPageScrollStart, + this.onPageScrollEnd, + this.onInBetweenOfPage, + this.isLoading = false, + this.scrollOffset = 100, + }) : assert(child != null), + super(key: key); + /// The [Widget] that this widget watches for changes on final Widget child; @@ -30,19 +45,6 @@ class LazyLoadScrollView extends StatefulWidget { /// Used to determine if loading of new data has finished. You should use set this if you aren't using a [FutureBuilder] or [StreamBuilder]. final bool isLoading; - /// Initiates a LazyLoadScrollView widget - const LazyLoadScrollView({ - Key key, - @required this.child, - this.onStartOfPage, - this.onEndOfPage, - this.onPageScrollStart, - this.onPageScrollEnd, - this.onInBetweenOfPage, - this.isLoading = false, - this.scrollOffset = 100, - }) : assert(child != null), - super(key: key); @override State createState() => _LazyLoadScrollViewState(); diff --git a/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart b/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart index 615f5374..a6a73012 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart @@ -12,9 +12,6 @@ import 'stream_chat_core.dart'; /// // API docs: https://getstream.io/chat/docs/flutter-dart/send_message/ class MessageSearchBloc extends StatefulWidget { - /// The widget child - final Widget child; - /// Instantiate a new MessageSearchBloc const MessageSearchBloc({ Key key, 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 a37dfd54..d454d8c9 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 @@ -32,13 +32,6 @@ import 'package:stream_chat/stream_chat.dart'; /// ``` /// class StreamChatCore extends StatefulWidget { - /// Instance of Stream Chat Client containing information about the current - /// application. - final Client client; - - /// Widget descendant. - final Widget child; - /// Constructor used for creating a new instance of [StreamChatCore]. /// /// [StreamChatCore] is a stateful widget which reacts to system events and updates diff --git a/packages/stream_chat_flutter_core/lib/src/users_bloc.dart b/packages/stream_chat_flutter_core/lib/src/users_bloc.dart index bef0cead..359985b3 100644 --- a/packages/stream_chat_flutter_core/lib/src/users_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/users_bloc.dart @@ -11,10 +11,6 @@ import 'stream_chat_core.dart'; /// /// API docs: https://getstream.io/chat/docs/flutter-dart/init_and_users/ class UsersBloc extends StatefulWidget { - /// The widget child - final Widget child; - - /// Instantiate a new UsersBloc /// Instantiate a new [UsersBloc]. The parameter [child] must be supplied and /// not null. const UsersBloc({ @@ -22,6 +18,9 @@ class UsersBloc extends StatefulWidget { @required this.child, }) : super(key: key); + /// The widget child + final Widget child; + @override UsersBlocState createState() => UsersBlocState();