update components for splitview
This commit is contained in:
@@ -56,17 +56,17 @@ class _SplitViewState extends State<SplitView> {
|
||||
flex: 1,
|
||||
),
|
||||
Flexible(
|
||||
child: selectedChannel != null
|
||||
child: Scaffold(
|
||||
body: selectedChannel != null
|
||||
? StreamChannel(
|
||||
key: ValueKey(selectedChannel.cid),
|
||||
child: ChannelPage(),
|
||||
channel: selectedChannel,
|
||||
)
|
||||
: Scaffold(
|
||||
body: Center(
|
||||
: Center(
|
||||
child: Text(
|
||||
'Pick a channel to show the messages 💬',
|
||||
style: Theme.of(context).textTheme.headline,
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -101,7 +101,6 @@ class ChannelListPage extends StatelessWidget {
|
||||
pagination: PaginationParams(
|
||||
limit: 20,
|
||||
),
|
||||
channelWidget: ChannelPage(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -115,6 +114,10 @@ class ChannelPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Navigator(
|
||||
onGenerateRoute: (settings) {
|
||||
return MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Scaffold(
|
||||
appBar: ChannelHeader(
|
||||
showBackButton: false,
|
||||
@@ -128,5 +131,9 @@ class ChannelPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: example
|
||||
description: A new Flutter project.
|
||||
|
||||
version: 1.0.11+13
|
||||
version: 1.0.12+14
|
||||
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
+14
-18
@@ -216,18 +216,14 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
child: Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
||||
child: Container(
|
||||
child: FractionallySizedBox(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Container(
|
||||
constraints: BoxConstraints.loose(
|
||||
Size.fromWidth(MediaQuery.of(context).size.width * 0.8),
|
||||
),
|
||||
widthFactor: 0.75,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
IntrinsicWidth(
|
||||
child: Column(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
@@ -243,8 +239,8 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
),
|
||||
if (widget.showUserAvatar == DisplayWidget.hide)
|
||||
SizedBox(
|
||||
width: widget.messageTheme.avatarTheme
|
||||
.constraints.maxWidth +
|
||||
width: widget.messageTheme.avatarTheme.constraints
|
||||
.maxWidth +
|
||||
8,
|
||||
),
|
||||
Flexible(
|
||||
@@ -260,8 +256,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
portal: _buildReactionIndicator(context),
|
||||
child: (widget.message.isDeleted &&
|
||||
widget.message.status !=
|
||||
MessageSendingStatus
|
||||
.FAILED_DELETE)
|
||||
MessageSendingStatus.FAILED_DELETE)
|
||||
? Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.rotationY(
|
||||
@@ -292,7 +287,6 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
_buildReplyIndicator(leftPadding),
|
||||
],
|
||||
),
|
||||
),
|
||||
if ((widget.message.createdAt != null &&
|
||||
widget.showTimestamp) ||
|
||||
widget.showUsername ||
|
||||
@@ -303,7 +297,6 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -447,8 +440,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
? Container(
|
||||
child: GestureDetector(
|
||||
onTap: () => onLongPress(context),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.3,
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.3,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 4.0,
|
||||
),
|
||||
@@ -462,11 +456,12 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Theme.of(context).brightness == Brightness.dark
|
||||
color: Theme.of(context).brightness ==
|
||||
Brightness.dark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(14)),
|
||||
),
|
||||
child: _buildReactionsText(context),
|
||||
),
|
||||
@@ -476,6 +471,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user