mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-25 19:00:45 +01:00
fix: File event design
This commit is contained in:
parent
b3ad9a3a70
commit
e9d02336e1
@ -8,6 +8,7 @@ import 'package:just_audio/just_audio.dart';
|
|||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/utils/localized_exception_extension.dart';
|
import 'package:fluffychat/utils/localized_exception_extension.dart';
|
||||||
import '../../../utils/matrix_sdk_extensions.dart/event_extension.dart';
|
import '../../../utils/matrix_sdk_extensions.dart/event_extension.dart';
|
||||||
|
|
||||||
@ -169,10 +170,11 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final statusText = this.statusText ??= _durationString ?? '00:00';
|
final statusText = this.statusText ??= _durationString ?? '00:00';
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
padding: EdgeInsets.all(16 * AppConfig.bubbleSizeFactor),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
const SizedBox(width: 4),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: buttonSize,
|
width: buttonSize,
|
||||||
height: buttonSize,
|
height: buttonSize,
|
||||||
|
@ -100,9 +100,13 @@ class Message extends StatelessWidget {
|
|||||||
final noBubble = {
|
final noBubble = {
|
||||||
MessageTypes.Video,
|
MessageTypes.Video,
|
||||||
MessageTypes.Image,
|
MessageTypes.Image,
|
||||||
MessageTypes.Sticker,
|
MessageTypes.Sticker
|
||||||
}.contains(event.messageType) &&
|
}.contains(event.messageType) &&
|
||||||
!event.redacted;
|
!event.redacted;
|
||||||
|
final noPadding = {
|
||||||
|
MessageTypes.File,
|
||||||
|
MessageTypes.Audio,
|
||||||
|
}.contains(event.messageType);
|
||||||
|
|
||||||
if (ownMessage) {
|
if (ownMessage) {
|
||||||
color = displayEvent.status.isError
|
color = displayEvent.status.isError
|
||||||
@ -187,7 +191,7 @@ class Message extends StatelessWidget {
|
|||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(AppConfig.borderRadius),
|
BorderRadius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
padding: noBubble
|
padding: noBubble || noPadding
|
||||||
? EdgeInsets.zero
|
? EdgeInsets.zero
|
||||||
: EdgeInsets.all(16 * AppConfig.bubbleSizeFactor),
|
: EdgeInsets.all(16 * AppConfig.bubbleSizeFactor),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
|
@ -51,24 +51,27 @@ class MessageDownloadContent extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
const Divider(),
|
const Divider(height: 1),
|
||||||
Row(
|
Padding(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
|
||||||
Text(
|
child: Row(
|
||||||
filetype,
|
children: [
|
||||||
style: TextStyle(
|
|
||||||
color: textColor.withAlpha(150),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
if (sizeString != null)
|
|
||||||
Text(
|
Text(
|
||||||
sizeString,
|
filetype,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: textColor.withAlpha(150),
|
color: textColor.withAlpha(150),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
const Spacer(),
|
||||||
|
if (sizeString != null)
|
||||||
|
Text(
|
||||||
|
sizeString,
|
||||||
|
style: TextStyle(
|
||||||
|
color: textColor.withAlpha(150),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user