deprecate old widgets

This commit is contained in:
Salvatore Giordano
2022-02-01 11:57:26 +01:00
parent f53ee0b4f1
commit e80cebe9aa
5 changed files with 27 additions and 17 deletions
@@ -130,7 +130,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
), ),
); );
}, },
leading: ChannelAvatar( leading: StreamChannelAvatar(
channel: channel, channel: channel,
), ),
title: StreamChannelName( title: StreamChannelName(
@@ -97,24 +97,21 @@ class ChannelPage extends StatelessWidget {
}) : super(key: key); }) : super(key: key);
@override @override
// ignore: prefer_expression_function_bodies Widget build(BuildContext context) => Scaffold(
Widget build(BuildContext context) { appBar: const ChannelHeader(),
return Scaffold( body: Column(
appBar: const ChannelHeader(), children: <Widget>[
body: Column( Expanded(
children: <Widget>[ child: MessageListView(
Expanded( threadBuilder: (_, parentMessage) => ThreadPage(
child: MessageListView( parent: parentMessage,
threadBuilder: (_, parentMessage) => ThreadPage( ),
parent: parentMessage,
), ),
), ),
), const MessageInput(),
const MessageInput(), ],
], ),
), );
);
}
} }
class ThreadPage extends StatelessWidget { class ThreadPage extends StatelessWidget {
@@ -44,6 +44,11 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// The widget renders the ui based on the first ancestor of type /// The widget renders the ui based on the first ancestor of type
/// [StreamChatTheme]. /// [StreamChatTheme].
/// Modify it to change the widget appearance. /// Modify it to change the widget appearance.
@Deprecated(
"'ChannelName' is deprecated and shouldn't be used. "
"Please use 'StreamChannelName' instead.",
)
class ChannelAvatar extends StatelessWidget { class ChannelAvatar extends StatelessWidget {
/// Instantiate a new ChannelImage /// Instantiate a new ChannelImage
const ChannelAvatar({ const ChannelAvatar({
@@ -52,6 +52,10 @@ typedef ViewInfoCallback = void Function(Channel);
/// The widget components render the ui based on the first ancestor of /// The widget components render the ui based on the first ancestor of
/// type [StreamChatTheme]. /// type [StreamChatTheme].
/// Modify it to change the widget appearance. /// Modify it to change the widget appearance.
@Deprecated(
"'ChannelListView' is deprecated and shouldn't be used. "
"Please use 'StreamChannelListView' instead.",
)
class ChannelListView extends StatefulWidget { class ChannelListView extends StatefulWidget {
/// Instantiate a new ChannelListView /// Instantiate a new ChannelListView
ChannelListView({ ChannelListView({
@@ -6,6 +6,10 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// ///
/// The widget uses a [StreamBuilder] to render the channel information /// The widget uses a [StreamBuilder] to render the channel information
/// image as soon as it updates. /// image as soon as it updates.
@Deprecated(
"'ChannelName' is deprecated and shouldn't be used. "
"Please use 'StreamChannelName' instead.",
)
class ChannelName extends StatelessWidget { class ChannelName extends StatelessWidget {
/// Instantiate a new ChannelName /// Instantiate a new ChannelName
const ChannelName({ const ChannelName({