[Thread Header] Redesign wrt new ui
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
+43
-36
@@ -1,7 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat/stream_chat.dart';
|
import 'package:stream_chat/stream_chat.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
|
||||||
|
import 'back_button.dart';
|
||||||
|
import 'channel_name.dart';
|
||||||
|
|
||||||
/// 
|
/// 
|
||||||
/// 
|
/// 
|
||||||
@@ -77,43 +79,48 @@ class ThreadHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
return AppBar(
|
return AppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
|
leading: showBackButton
|
||||||
|
? StreamBackButton(
|
||||||
|
onPressed: onBackPressed,
|
||||||
|
showUnreads: true,
|
||||||
|
)
|
||||||
|
: SizedBox(),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
|
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
|
||||||
actions: <Widget>[
|
centerTitle: true,
|
||||||
Container(
|
title: Column(
|
||||||
child: showBackButton
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
? AspectRatio(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
aspectRatio: 1,
|
children: [
|
||||||
child: IconButton(
|
Text(
|
||||||
onPressed: onBackPressed ?? () => Navigator.pop(context),
|
'Thread Reply',
|
||||||
icon: StreamSvgIcon.close(
|
style: StreamChatTheme.of(context)
|
||||||
size: 24,
|
.channelTheme
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
.channelHeaderTheme
|
||||||
? Colors.white
|
.title,
|
||||||
: Colors.black,
|
),
|
||||||
),
|
SizedBox(height: 2),
|
||||||
),
|
Row(
|
||||||
)
|
mainAxisSize: MainAxisSize.min,
|
||||||
: SizedBox(),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
],
|
children: [
|
||||||
centerTitle: false,
|
Text(
|
||||||
title: Text.rich(
|
'with ',
|
||||||
TextSpan(
|
style: StreamChatTheme.of(context)
|
||||||
text: 'Thread',
|
.channelTheme
|
||||||
children: [
|
.channelHeaderTheme
|
||||||
TextSpan(
|
.lastMessageAt,
|
||||||
text:
|
),
|
||||||
' ${parent.replyCount} ${parent.replyCount == 1 ? 'reply' : 'replies'}',
|
ChannelName(
|
||||||
style: StreamChatTheme.of(context)
|
textStyle: StreamChatTheme.of(context)
|
||||||
.channelTheme
|
.channelTheme
|
||||||
.channelHeaderTheme
|
.channelHeaderTheme
|
||||||
.lastMessageAt,
|
.lastMessageAt,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
style:
|
],
|
||||||
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.title,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user