Remove message bubbles

This commit is contained in:
Christian Pauly 2020-09-19 16:21:57 +02:00
parent 8547422f80
commit 7b1262f355
5 changed files with 31 additions and 46 deletions

View File

@ -1,4 +1,3 @@
import 'package:bubble/bubble.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/utils/app_route.dart';
import 'package:fluffychat/views/image_view.dart';
@ -71,11 +70,8 @@ class _ImageBubbleState extends State<ImageBubble> {
@override
Widget build(BuildContext context) {
return Bubble(
padding: BubbleEdges.all(0),
radius: Radius.circular(widget.radius),
color: widget.backgroundColor ?? Theme.of(context).secondaryHeaderColor,
elevation: 0,
return ClipRRect(
borderRadius: BorderRadius.circular(widget.radius),
child: Container(
height: widget.maxSize ? 300 : null,
width: widget.maxSize ? 400 : null,

View File

@ -1,4 +1,3 @@
import 'package:bubble/bubble.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
import 'package:fluffychat/components/message_content.dart';
@ -9,7 +8,6 @@ import 'package:fluffychat/utils/event_extension.dart';
import 'package:fluffychat/utils/string_color.dart';
import 'package:flutter/material.dart';
import '../adaptive_page_layout.dart';
import '../avatar.dart';
import '../matrix.dart';
import '../message_reactions.dart';
@ -56,9 +54,6 @@ class Message extends StatelessWidget {
[EventTypes.Message, EventTypes.Sticker].contains(nextEvent.type)
? nextEvent.sender.id == event.sender.id
: false;
var nip = sameSender
? BubbleNip.no
: ownMessage ? BubbleNip.rightBottom : BubbleNip.leftBottom;
var textColor = ownMessage
? Colors.white
: Theme.of(context).brightness == Brightness.dark
@ -70,7 +65,7 @@ class Message extends StatelessWidget {
final displayEvent = event.getDisplayEvent(timeline);
if (event.showThumbnail) {
color = Theme.of(context).scaffoldBackgroundColor.withOpacity(0.66);
color = Theme.of(context).scaffoldBackgroundColor;
textColor = Theme.of(context).textTheme.bodyText2.color;
} else if (ownMessage) {
color = displayEvent.status == -1
@ -78,18 +73,19 @@ class Message extends StatelessWidget {
: Theme.of(context).primaryColor;
}
final radius = 16.0;
var rowChildren = <Widget>[
Expanded(
child: Bubble(
elevation: 0,
radius: Radius.circular(8),
child: Container(
alignment: alignment,
margin: BubbleEdges.symmetric(horizontal: 4),
color: color,
nip: nip,
child: Container(
constraints:
BoxConstraints(maxWidth: AdaptivePageLayout.defaultMinWidth),
margin: const EdgeInsets.symmetric(horizontal: 8),
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(radius),
),
child: Stack(
children: <Widget>[
Column(
@ -220,15 +216,12 @@ class Message extends StatelessWidget {
onTap: !useMouse && longPressSelect ? () => null : () => onSelect(event),
splashColor: Theme.of(context).primaryColor.withAlpha(100),
onLongPress: !longPressSelect ? null : () => onSelect(event),
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.fastOutSlowIn,
child: Container(
color: selected
? Theme.of(context).primaryColor.withAlpha(100)
: Theme.of(context).primaryColor.withAlpha(0),
child: Padding(
padding: EdgeInsets.only(
left: 8.0, right: 8.0, bottom: sameSender ? 4.0 : 8.0),
padding: EdgeInsets.only(left: 8.0, right: 8.0, bottom: 8.0),
child: container,
),
),
@ -262,22 +255,25 @@ class _MetaRow extends StatelessWidget {
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: displayname.color,
color: displayname.color.withAlpha(200),
),
),
if (showDisplayname) SizedBox(width: 4),
Text(
event.originServerTs.localizedTime(context),
style: TextStyle(
color: color,
color: color.withAlpha(200),
fontSize: 11,
),
),
if (event.hasAggregatedEvents(timeline, RelationshipTypes.Edit))
Icon(
Icons.edit,
size: 12,
color: color,
Padding(
padding: const EdgeInsets.only(left: 2.0),
child: Icon(
Icons.edit,
size: 12,
color: color,
),
),
if (ownMessage) SizedBox(width: 2),
if (ownMessage)

View File

@ -1,4 +1,3 @@
import 'package:bubble/bubble.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/l10n/l10n.dart';
import 'package:flutter/material.dart';
@ -14,12 +13,14 @@ class StateMessage extends StatelessWidget {
padding: const EdgeInsets.only(
left: 8.0,
right: 8.0,
bottom: 8.0,
bottom: 16.0,
),
child: Bubble(
elevation: 0,
color: Theme.of(context).backgroundColor.withOpacity(0.66),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: Theme.of(context).backgroundColor.withOpacity(0.66),
borderRadius: BorderRadius.circular(7),
),
child: Text(
event.getLocalizedBody(L10n.of(context)),
textAlign: TextAlign.center,

View File

@ -71,13 +71,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
bubble:
dependency: "direct main"
description:
name: bubble
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.9+1"
cached_network_image:
dependency: "direct main"
description:
@ -187,8 +180,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "510de0530434e392a281f197f77a9c49349e7fc2"
resolved-ref: "510de0530434e392a281f197f77a9c49349e7fc2"
ref: "864cbfa9068f5bb285336ca73ab2551204e62044"
resolved-ref: "864cbfa9068f5bb285336ca73ab2551204e62044"
url: "https://gitlab.com/famedly/famedlysdk.git"
source: git
version: "0.0.1"

View File

@ -30,7 +30,6 @@ dependencies:
ref: 864cbfa9068f5bb285336ca73ab2551204e62044
localstorage: ^3.0.1+4
bubble: ^1.1.9+1
memoryfilepicker: ^0.1.3
url_launcher: ^5.4.1
url_launcher_web: ^0.1.0