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