fix: File event design

This commit is contained in:
Krille Fear 2022-12-30 10:36:54 +01:00
parent b3ad9a3a70
commit e9d02336e1
3 changed files with 25 additions and 16 deletions

View File

@ -8,6 +8,7 @@ import 'package:just_audio/just_audio.dart';
import 'package:matrix/matrix.dart';
import 'package:path_provider/path_provider.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/localized_exception_extension.dart';
import '../../../utils/matrix_sdk_extensions.dart/event_extension.dart';
@ -169,10 +170,11 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
Widget build(BuildContext context) {
final statusText = this.statusText ??= _durationString ?? '00:00';
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 6.0),
padding: EdgeInsets.all(16 * AppConfig.bubbleSizeFactor),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const SizedBox(width: 4),
SizedBox(
width: buttonSize,
height: buttonSize,

View File

@ -100,9 +100,13 @@ class Message extends StatelessWidget {
final noBubble = {
MessageTypes.Video,
MessageTypes.Image,
MessageTypes.Sticker,
MessageTypes.Sticker
}.contains(event.messageType) &&
!event.redacted;
final noPadding = {
MessageTypes.File,
MessageTypes.Audio,
}.contains(event.messageType);
if (ownMessage) {
color = displayEvent.status.isError
@ -187,7 +191,7 @@ class Message extends StatelessWidget {
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
),
padding: noBubble
padding: noBubble || noPadding
? EdgeInsets.zero
: EdgeInsets.all(16 * AppConfig.bubbleSizeFactor),
constraints: const BoxConstraints(

View File

@ -51,24 +51,27 @@ class MessageDownloadContent extends StatelessWidget {
)
: null,
),
const Divider(),
Row(
children: [
Text(
filetype,
style: TextStyle(
color: textColor.withAlpha(150),
),
),
const Spacer(),
if (sizeString != null)
const Divider(height: 1),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Row(
children: [
Text(
sizeString,
filetype,
style: TextStyle(
color: textColor.withAlpha(150),
),
),
],
const Spacer(),
if (sizeString != null)
Text(
sizeString,
style: TextStyle(
color: textColor.withAlpha(150),
),
),
],
),
),
],
),