opt desktop chat page style

This commit is contained in:
csf 2022-10-14 23:50:13 +09:00
parent c67c55f74b
commit 516ff4221b
3 changed files with 56 additions and 37 deletions

View File

@ -36,7 +36,7 @@ class DraggableChatWindow extends StatelessWidget {
appBar: CustomAppBar(
onPanUpdate: onPanUpdate,
appBar: isDesktop
? _buildDesktopAppBar()
? _buildDesktopAppBar(context)
: _buildMobileAppBar(context),
),
body: ChatPage(chatModel: chatModel),
@ -82,33 +82,33 @@ class DraggableChatWindow extends StatelessWidget {
);
}
Widget _buildDesktopAppBar() {
Widget _buildDesktopAppBar(BuildContext context) {
return Container(
color: MyTheme.accent50,
height: 35,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).hintColor.withOpacity(0.4)))),
height: 38,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Text(
translate("Chat"),
style: const TextStyle(
color: Colors.white,
fontFamily: 'WorkSans',
fontWeight: FontWeight.bold),
)),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ActionIcon(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
child: Row(children: [
Icon(Icons.chat_bubble_outline,
size: 20, color: Theme.of(context).colorScheme.primary),
SizedBox(width: 6),
Text(translate("Chat"))
])),
Padding(
padding: EdgeInsets.all(2),
child: ActionIcon(
message: 'Close',
icon: IconFont.close,
onTap: chatModel.hideChatWindowOverlay,
isClose: true,
)
],
)
size: 32,
))
],
),
);

View File

@ -799,13 +799,15 @@ class ActionIcon extends StatelessWidget {
final IconData icon;
final Function() onTap;
final bool isClose;
const ActionIcon({
Key? key,
required this.message,
required this.icon,
required this.onTap,
required this.isClose,
}) : super(key: key);
final double? size;
const ActionIcon(
{Key? key,
required this.message,
required this.icon,
required this.onTap,
required this.isClose,
this.size})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -820,8 +822,8 @@ class ActionIcon extends StatelessWidget {
onHover: (value) => hover.value = value,
onTap: onTap,
child: SizedBox(
height: _kTabBarHeight - 1,
width: _kTabBarHeight - 1,
height: size ?? (_kTabBarHeight - 1),
width: size ?? (_kTabBarHeight - 1),
child: Icon(
icon,
color: hover.value && isClose

View File

@ -61,19 +61,36 @@ class ChatPage extends StatelessWidget implements PageShape {
[],
inputOptions: InputOptions(
sendOnEnter: true,
inputDecoration: defaultInputDecoration(
hintText: "${translate('Write a message')}...",
fillColor: Theme.of(context).backgroundColor),
sendButtonBuilder: defaultSendButton(
color: Theme.of(context)
.textTheme
.titleLarge!
.color!),
inputTextStyle: TextStyle(
fontSize: 14,
color: Theme.of(context)
.textTheme
.titleLarge
?.color)),
?.color),
inputDecoration: isDesktop
? InputDecoration(
isDense: true,
hintText:
"${translate('Write a message')}...",
filled: true,
fillColor: Theme.of(context).backgroundColor,
contentPadding: EdgeInsets.all(10),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: const BorderSide(
width: 0,
style: BorderStyle.none,
),
),
)
: defaultInputDecoration(
hintText:
"${translate('Write a message')}...",
fillColor: Theme.of(context).backgroundColor),
sendButtonBuilder: defaultSendButton(
padding: EdgeInsets.symmetric(
horizontal: 6, vertical: 0),
color: Theme.of(context).colorScheme.primary)),
messageOptions: MessageOptions(
showOtherUsersAvatar: false,
showTime: true,