opt desktop chat page style
This commit is contained in:
parent
c67c55f74b
commit
516ff4221b
@ -36,7 +36,7 @@ class DraggableChatWindow extends StatelessWidget {
|
|||||||
appBar: CustomAppBar(
|
appBar: CustomAppBar(
|
||||||
onPanUpdate: onPanUpdate,
|
onPanUpdate: onPanUpdate,
|
||||||
appBar: isDesktop
|
appBar: isDesktop
|
||||||
? _buildDesktopAppBar()
|
? _buildDesktopAppBar(context)
|
||||||
: _buildMobileAppBar(context),
|
: _buildMobileAppBar(context),
|
||||||
),
|
),
|
||||||
body: ChatPage(chatModel: chatModel),
|
body: ChatPage(chatModel: chatModel),
|
||||||
@ -82,33 +82,33 @@ class DraggableChatWindow extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDesktopAppBar() {
|
Widget _buildDesktopAppBar(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: MyTheme.accent50,
|
decoration: BoxDecoration(
|
||||||
height: 35,
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Theme.of(context).hintColor.withOpacity(0.4)))),
|
||||||
|
height: 38,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
|
||||||
child: Text(
|
child: Row(children: [
|
||||||
translate("Chat"),
|
Icon(Icons.chat_bubble_outline,
|
||||||
style: const TextStyle(
|
size: 20, color: Theme.of(context).colorScheme.primary),
|
||||||
color: Colors.white,
|
SizedBox(width: 6),
|
||||||
fontFamily: 'WorkSans',
|
Text(translate("Chat"))
|
||||||
fontWeight: FontWeight.bold),
|
])),
|
||||||
)),
|
Padding(
|
||||||
Row(
|
padding: EdgeInsets.all(2),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: ActionIcon(
|
||||||
children: [
|
|
||||||
ActionIcon(
|
|
||||||
message: 'Close',
|
message: 'Close',
|
||||||
icon: IconFont.close,
|
icon: IconFont.close,
|
||||||
onTap: chatModel.hideChatWindowOverlay,
|
onTap: chatModel.hideChatWindowOverlay,
|
||||||
isClose: true,
|
isClose: true,
|
||||||
)
|
size: 32,
|
||||||
],
|
))
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -799,13 +799,15 @@ class ActionIcon extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
final Function() onTap;
|
final Function() onTap;
|
||||||
final bool isClose;
|
final bool isClose;
|
||||||
const ActionIcon({
|
final double? size;
|
||||||
Key? key,
|
const ActionIcon(
|
||||||
required this.message,
|
{Key? key,
|
||||||
required this.icon,
|
required this.message,
|
||||||
required this.onTap,
|
required this.icon,
|
||||||
required this.isClose,
|
required this.onTap,
|
||||||
}) : super(key: key);
|
required this.isClose,
|
||||||
|
this.size})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -820,8 +822,8 @@ class ActionIcon extends StatelessWidget {
|
|||||||
onHover: (value) => hover.value = value,
|
onHover: (value) => hover.value = value,
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: _kTabBarHeight - 1,
|
height: size ?? (_kTabBarHeight - 1),
|
||||||
width: _kTabBarHeight - 1,
|
width: size ?? (_kTabBarHeight - 1),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
icon,
|
icon,
|
||||||
color: hover.value && isClose
|
color: hover.value && isClose
|
||||||
|
@ -61,19 +61,36 @@ class ChatPage extends StatelessWidget implements PageShape {
|
|||||||
[],
|
[],
|
||||||
inputOptions: InputOptions(
|
inputOptions: InputOptions(
|
||||||
sendOnEnter: true,
|
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(
|
inputTextStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.titleLarge
|
.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(
|
messageOptions: MessageOptions(
|
||||||
showOtherUsersAvatar: false,
|
showOtherUsersAvatar: false,
|
||||||
showTime: true,
|
showTime: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user