Commit fe21c0ea authored by Wilko Manger's avatar Wilko Manger

Add sent state indicator to image messages

parent 5aef753b
Pipeline #359 passed with stages
in 7 minutes and 3 seconds
......@@ -60,13 +60,24 @@ class ImageBubble extends MessageBubble {
@override
Widget buildTime(BuildContext context, {Color color}) {
var alignment, borderRadius;
var alignment, borderRadius, content;
if (isMine) {
alignment = Alignment.bottomRight;
borderRadius = this.borderRadius();
content = Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
buildSentState(context),
SizedBox(width: 4),
super.buildTime(context, color: Colors.white)
],
);
} else {
alignment = Alignment.bottomLeft;
borderRadius = const BorderRadius.all(Bubble.radiusForBorder);
content = super.buildTime(context, color: Colors.white);
}
if (isEndOfGroup) {
......@@ -81,7 +92,7 @@ class ImageBubble extends MessageBubble {
),
child: Padding(
padding: EdgeInsets.all(4),
child: super.buildTime(context, color: Colors.white),
child: content
)
),
)
......
......@@ -219,6 +219,15 @@ abstract class MessageBubble extends Bubble {
);
}
@protected
Widget buildSentState(BuildContext context) =>
Icon(event.sentState == SentState.waiting
? Icons.access_time
: Icons.check,
color: Colors.white,
size: 14
);
Widget _buildMine(BuildContext context) =>
Column(
crossAxisAlignment: CrossAxisAlignment.end,
......
......@@ -49,19 +49,12 @@ class TextBubble extends MessageBubble {
Widget bottom = Container(height: 0, width: 0);
if (isEndOfGroup) {
final icon = event.sentState == SentState.waiting
? Icons.access_time
: Icons.check;
bottom = Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Icon(icon,
color: Colors.white,
size: 14
),
buildSentState(context),
SizedBox(width: 4),
buildTime(context),
],
......
......@@ -68,7 +68,7 @@ class StartBloc {
var user;
// Check if there is a ':' in the username,
// if so, treat it as a full Matrix ID (without or without '@').
// if so, treat it as a full Matrix ID (with or without '@').
// Otherwise use the local part (with or without '@').
// So, accept all of these formats:
// @joe:matrix.org
......@@ -76,11 +76,11 @@ class StartBloc {
// joe
// @joe
if (username.contains(':')) {
var split = username.split(':');
final split = username.split(':');
String server = split[1];
try {
var serverUri = Uri.parse("https://$server");
final serverUri = Uri.parse("https://$server");
_setHomeserver(serverUri);
// Add an '@' if the username does not have one, to allow
......@@ -143,7 +143,9 @@ class StartBloc {
_username,
password,
store: di.getStore()
).asStream()
).catchError((error) {
throw error;
}).asStream()
)
.map((user) {
di.registerLocalUser(user);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment