feat: Fixed conflicts, added group info screen
This commit is contained in:
@@ -398,6 +398,34 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
limit: 20,
|
||||
),
|
||||
channelWidget: ChannelPage(),
|
||||
onViewInfoTap: (channel) {
|
||||
if (channel.memberCount == 2 &&
|
||||
channel.isDistinct) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: ChatInfoScreen(
|
||||
user: channel.state.members.first.user,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: GroupInfoScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Add group screen
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -22,6 +22,8 @@ typedef ChannelTapCallback = void Function(Channel, Widget);
|
||||
/// Builder used to create a custom [ChannelPreview] from a [Channel]
|
||||
typedef ChannelPreviewBuilder = Widget Function(BuildContext, Channel);
|
||||
|
||||
typedef ViewInfoCallback = void Function(Channel);
|
||||
|
||||
/// 
|
||||
/// 
|
||||
///
|
||||
@@ -77,6 +79,7 @@ class ChannelListView extends StatefulWidget {
|
||||
this.crossAxisCount = 1,
|
||||
this.padding,
|
||||
this.selectedChannels = const [],
|
||||
this.onViewInfoTap,
|
||||
}) : super(key: key);
|
||||
|
||||
/// The builder that will be used in case of error
|
||||
@@ -145,6 +148,8 @@ class ChannelListView extends StatefulWidget {
|
||||
|
||||
final List<Channel> selectedChannels;
|
||||
|
||||
final ViewInfoCallback onViewInfoTap;
|
||||
|
||||
@override
|
||||
_ChannelListViewState createState() => _ChannelListViewState();
|
||||
}
|
||||
@@ -579,23 +584,7 @@ class _ChannelListViewState extends State<ChannelListView>
|
||||
return StreamChannel(
|
||||
child: ChannelBottomSheet(
|
||||
onViewInfoTap: () {
|
||||
if (channel.memberCount == 2 &&
|
||||
channel.isDistinct) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: ChatInfoScreen(
|
||||
user:
|
||||
channel.state.members.first.user,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Add group screen
|
||||
widget.onViewInfoTap(channel);
|
||||
},
|
||||
),
|
||||
channel: channel,
|
||||
|
||||
@@ -26,18 +26,12 @@ class OptionListTile extends StatelessWidget {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
color: separatorColor ?? Color(0xffe6e6e6),
|
||||
color: separatorColor ??
|
||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
height: 2.0,
|
||||
),
|
||||
Material(
|
||||
color: tileColor ?? Colors.white,
|
||||
child: Container(
|
||||
height: 56.0,
|
||||
color: StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
height: 1.0,
|
||||
),
|
||||
Material(
|
||||
color: StreamChatTheme.of(context).colorTheme.white,
|
||||
color: tileColor ?? StreamChatTheme.of(context).colorTheme.white,
|
||||
child: Container(
|
||||
height: 63.0,
|
||||
child: InkWell(
|
||||
|
||||
Reference in New Issue
Block a user