mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 22:51:00 -04:00
wallpapers and ui cleanup
This commit is contained in:
parent
77c68aa45f
commit
6bd60207d8
32 changed files with 17947 additions and 150 deletions
|
@ -82,15 +82,16 @@ class ChatComponentWidget extends StatelessWidget {
|
|||
|
||||
Widget _buildChatComponent(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final scaleScheme = theme.extension<ScaleScheme>()!;
|
||||
final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||
final scale = scaleScheme.scale(ScaleKind.primary);
|
||||
final textTheme = theme.textTheme;
|
||||
final chatTheme = makeChatTheme(scale, scaleConfig, textTheme);
|
||||
final chatTheme = makeChatTheme(scaleScheme, scaleConfig, textTheme);
|
||||
final errorChatTheme = (ChatThemeEditor(chatTheme)
|
||||
..inputTextColor = scale.errorScale.primary
|
||||
..inputTextColor = scaleScheme.errorScale.primary
|
||||
..sendButtonIcon = Image.asset(
|
||||
'assets/icon-send.png',
|
||||
color: scale.errorScale.primary,
|
||||
color: scaleScheme.errorScale.primary,
|
||||
package: 'flutter_chat_ui',
|
||||
))
|
||||
.commit();
|
||||
|
@ -126,7 +127,7 @@ class ChatComponentWidget extends StatelessWidget {
|
|||
Container(
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: scale.primaryScale.subtleBorder,
|
||||
color: scale.border,
|
||||
),
|
||||
child: Row(children: [
|
||||
Align(
|
||||
|
@ -136,12 +137,11 @@ class ChatComponentWidget extends StatelessWidget {
|
|||
child: Text(title,
|
||||
textAlign: TextAlign.start,
|
||||
style: textTheme.titleMedium!
|
||||
.copyWith(color: scale.primaryScale.borderText)),
|
||||
.copyWith(color: scale.borderText)),
|
||||
)),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon:
|
||||
Icon(Icons.close, color: scale.primaryScale.borderText),
|
||||
icon: Icon(Icons.close, color: scale.borderText),
|
||||
onPressed: _onClose)
|
||||
.paddingLTRB(16, 0, 16, 0)
|
||||
]),
|
||||
|
@ -201,54 +201,51 @@ class ChatComponentWidget extends StatelessWidget {
|
|||
2048;
|
||||
|
||||
return Chat(
|
||||
key: chatComponentState.chatKey,
|
||||
theme:
|
||||
messageIsValid ? chatTheme : errorChatTheme,
|
||||
messages: messageWindow.window.toList(),
|
||||
scrollToBottomOnSend: isFirstPage,
|
||||
scrollController:
|
||||
chatComponentState.scrollController,
|
||||
inputOptions: InputOptions(
|
||||
inputClearMode: messageIsValid
|
||||
? InputClearMode.always
|
||||
: InputClearMode.never,
|
||||
textEditingController:
|
||||
chatComponentState.textEditingController),
|
||||
// isLastPage: isLastPage,
|
||||
// onEndReached: () async {
|
||||
// await _handlePageBackward(
|
||||
// chatComponentCubit, messageWindow);
|
||||
// },
|
||||
//onEndReachedThreshold: onEndReachedThreshold,
|
||||
//onAttachmentPressed: _handleAttachmentPressed,
|
||||
//onMessageTap: _handleMessageTap,
|
||||
//onPreviewDataFetched: _handlePreviewDataFetched,
|
||||
usePreviewData: false, //
|
||||
onSendPressed: (pt) {
|
||||
try {
|
||||
if (!messageIsValid) {
|
||||
context.read<NotificationsCubit>().error(
|
||||
text:
|
||||
translate('chat.message_too_long'));
|
||||
return;
|
||||
}
|
||||
_handleSendPressed(chatComponentCubit, pt);
|
||||
} on FormatException {
|
||||
context.read<NotificationsCubit>().error(
|
||||
text: translate('chat.message_too_long'));
|
||||
}
|
||||
},
|
||||
listBottomWidget: messageIsValid
|
||||
? null
|
||||
: Text(translate('chat.message_too_long'),
|
||||
style: TextStyle(
|
||||
color: scale.errorScale.primary))
|
||||
.toCenter(),
|
||||
//showUserAvatars: false,
|
||||
//showUserNames: true,
|
||||
user: localUser,
|
||||
emptyState: const EmptyChatWidget())
|
||||
.paddingLTRB(0, 2, 0, 0);
|
||||
key: chatComponentState.chatKey,
|
||||
theme: messageIsValid ? chatTheme : errorChatTheme,
|
||||
messages: messageWindow.window.toList(),
|
||||
scrollToBottomOnSend: isFirstPage,
|
||||
scrollController: chatComponentState.scrollController,
|
||||
inputOptions: InputOptions(
|
||||
inputClearMode: messageIsValid
|
||||
? InputClearMode.always
|
||||
: InputClearMode.never,
|
||||
textEditingController:
|
||||
chatComponentState.textEditingController),
|
||||
// isLastPage: isLastPage,
|
||||
// onEndReached: () async {
|
||||
// await _handlePageBackward(
|
||||
// chatComponentCubit, messageWindow);
|
||||
// },
|
||||
//onEndReachedThreshold: onEndReachedThreshold,
|
||||
//onAttachmentPressed: _handleAttachmentPressed,
|
||||
//onMessageTap: _handleMessageTap,
|
||||
//onPreviewDataFetched: _handlePreviewDataFetched,
|
||||
usePreviewData: false, //
|
||||
onSendPressed: (pt) {
|
||||
try {
|
||||
if (!messageIsValid) {
|
||||
context.read<NotificationsCubit>().error(
|
||||
text: translate('chat.message_too_long'));
|
||||
return;
|
||||
}
|
||||
_handleSendPressed(chatComponentCubit, pt);
|
||||
} on FormatException {
|
||||
context.read<NotificationsCubit>().error(
|
||||
text: translate('chat.message_too_long'));
|
||||
}
|
||||
},
|
||||
listBottomWidget: messageIsValid
|
||||
? null
|
||||
: Text(translate('chat.message_too_long'),
|
||||
style: TextStyle(
|
||||
color:
|
||||
scaleScheme.errorScale.primary))
|
||||
.toCenter(),
|
||||
//showUserAvatars: false,
|
||||
//showUserNames: true,
|
||||
user: localUser,
|
||||
emptyState: const EmptyChatWidget());
|
||||
}))).expanded(),
|
||||
],
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue