Changed Media bubbles to tansparent bubbles

This commit is contained in:
Elias Müller 2023-02-25 10:58:06 +01:00
parent 37a0d5cb4a
commit b9424a9f4a
2 changed files with 24 additions and 20 deletions

View File

@ -33,7 +33,7 @@ class RichObjectStringProcessor {
return const Padding(padding: EdgeInsets.all(10), child: CircularProgressIndicator());
},
fadeInDuration: const Duration(seconds: 1),
imageUrl: "https://cloud.marianum-fulda.de/core/preview?fileId=${value.id}&x=110&y=-1&a=1",
imageUrl: "https://cloud.marianum-fulda.de/core/preview?fileId=${value.id}&x=100&y=-1&a=1",
httpHeaders: {
"Authorization": "Basic ${base64.encode(utf8.encode("${preferences.getString("username")}:${preferences.getString("password")}"))}"
},

View File

@ -29,23 +29,27 @@ class _ChatViewState extends State<ChatView> {
alignment: Alignment.center,
);
static const styleOther = BubbleStyle(
nip: BubbleNip.leftTop,
color: Colors.white,
borderWidth: 1,
elevation: 1,
margin: BubbleEdges.only(top: 15, left: 10, right: 50),
alignment: Alignment.topLeft,
);
static BubbleStyle getStyleOther(bool seamless) {
return BubbleStyle(
nip: BubbleNip.leftTop,
color: seamless ? Colors.transparent : Colors.white,
borderWidth: seamless ? 0 : 1,
elevation: seamless ? 0 : 1,
margin: const BubbleEdges.only(top: 15, left: 10, right: 50),
alignment: Alignment.topLeft,
);
}
static const styleSelf = BubbleStyle(
nip: BubbleNip.rightBottom,
color: Color(0xffd9fdd3),
borderWidth: 1,
elevation: 1,
margin: BubbleEdges.only(top: 15, right: 10, left: 50),
alignment: Alignment.topRight,
);
static BubbleStyle getStyleSelf(bool seamless) {
return BubbleStyle(
nip: BubbleNip.rightBottom,
color: seamless ? Colors.transparent : const Color(0xffd9fdd3),
borderWidth: seamless ? 0 : 1,
elevation: seamless ? 0 : 1,
margin: const BubbleEdges.only(top: 15, right: 10, left: 50),
alignment: Alignment.topRight,
);
}
final ScrollController _listController = ScrollController();
final TextEditingController _textBoxController = TextEditingController();
@ -78,9 +82,9 @@ class _ChatViewState extends State<ChatView> {
BubbleStyle currentStyle;
if(element.messageType == GetRoomResponseObjectMessageType.comment) {
if(element.actorId == widget.selfId) {
currentStyle = styleSelf;
currentStyle = getStyleSelf(element.messageParameters?.containsKey("file") ?? false);
} else {
currentStyle = styleOther;
currentStyle = getStyleOther(element.messageParameters?.containsKey("file") ?? false);
}
} else {
currentStyle = styleSystem;
@ -95,7 +99,7 @@ class _ChatViewState extends State<ChatView> {
child: Container(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.9,
minWidth: _textSize(element.actorDisplayName, _actorTextStyle).width,
minWidth: showActorDisplayName ? _textSize(element.actorDisplayName, _actorTextStyle).width : 30,
),
child: Stack(
children: [