update components for splitview

This commit is contained in:
Salvatore Giordano
2020-08-03 15:56:00 +02:00
parent d008bc01ac
commit b95efa0ea5
3 changed files with 128 additions and 125 deletions
+30 -23
View File
@@ -56,20 +56,20 @@ class _SplitViewState extends State<SplitView> {
flex: 1,
),
Flexible(
child: selectedChannel != null
? StreamChannel(
key: ValueKey(selectedChannel.cid),
child: ChannelPage(),
channel: selectedChannel,
)
: Scaffold(
body: Center(
child: Scaffold(
body: selectedChannel != null
? StreamChannel(
key: ValueKey(selectedChannel.cid),
child: ChannelPage(),
channel: selectedChannel,
)
: Center(
child: Text(
'Pick a channel to show the messages 💬',
style: Theme.of(context).textTheme.headline,
style: Theme.of(context).textTheme.headline5,
),
),
),
),
flex: 2,
),
],
@@ -101,7 +101,6 @@ class ChannelListPage extends StatelessWidget {
pagination: PaginationParams(
limit: 20,
),
channelWidget: ChannelPage(),
),
),
);
@@ -115,18 +114,26 @@ class ChannelPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: ChannelHeader(
showBackButton: false,
),
body: Column(
children: <Widget>[
Expanded(
child: MessageListView(),
),
MessageInput(),
],
),
return Navigator(
onGenerateRoute: (settings) {
return MaterialPageRoute(
builder: (context) {
return Scaffold(
appBar: ChannelHeader(
showBackButton: false,
),
body: Column(
children: <Widget>[
Expanded(
child: MessageListView(),
),
MessageInput(),
],
),
);
},
);
},
);
}
}