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