Add Link text

This commit is contained in:
Christian Pauly 2020-01-04 08:37:09 +00:00
parent 2c047d9b21
commit 2cc29e7004
4 changed files with 28 additions and 21 deletions

View file

@ -11,11 +11,11 @@ code_analyze:
script: script:
- flutter analyze - flutter analyze
#test: test:
# stage: coverage stage: coverage
# dependencies: [] dependencies: []
# script: script:
# - flutter test - flutter test
build_web: build_web:
stage: coverage stage: coverage
@ -45,17 +45,6 @@ build_android_fdroid:
only: only:
- master - master
build_android_debug:
stage: coverage
script:
- flutter build apk --debug
artifacts:
when: on_success
paths:
- build/app/outputs/apk/release/app-debug.apk
except:
- master
pages: pages:
stage: publish stage: publish
image: ruby:2.3 image: ruby:2.3

View file

@ -3,6 +3,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:famedlysdk/famedlysdk.dart'; import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:link_text/link_text.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'matrix.dart'; import 'matrix.dart';
@ -85,11 +86,20 @@ class MessageContent extends StatelessWidget {
? "You: " ? "You: "
: "${event.sender.calcDisplayname()}: " : "${event.sender.calcDisplayname()}: "
: ""; : "";
return Text( if (textOnly) {
senderPrefix + event.getBody(), return Text(
maxLines: maxLines, senderPrefix + event.getBody(),
overflow: textOnly ? TextOverflow.ellipsis : null, maxLines: maxLines,
style: TextStyle( overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
);
}
return LinkText(
text: senderPrefix + event.getBody(),
textStyle: TextStyle(
color: textColor, color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null, decoration: event.redacted ? TextDecoration.lineThrough : null,
), ),

View file

@ -172,6 +172,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.0" version: "2.4.0"
link_text:
dependency: "direct main"
description:
name: link_text
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
localstorage: localstorage:
dependency: "direct main" dependency: "direct main"
description: description:

View file

@ -39,6 +39,7 @@ dependencies:
sqflite: ^1.2.0 sqflite: ^1.2.0
cached_network_image: ^2.0.0 cached_network_image: ^2.0.0
firebase_messaging: ^6.0.9 firebase_messaging: ^6.0.9
link_text: ^0.1.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: