Merge branch 'add-linktext' into 'master'

Add Link text

See merge request ChristianPauly/fluffychat-flutter!6
This commit is contained in:
Christian Pauly 2020-01-04 08:37:09 +00:00
commit 10fc137435
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,15 +86,24 @@ class MessageContent extends StatelessWidget {
? "You: " ? "You: "
: "${event.sender.calcDisplayname()}: " : "${event.sender.calcDisplayname()}: "
: ""; : "";
if (textOnly) {
return Text( return Text(
senderPrefix + event.getBody(), senderPrefix + event.getBody(),
maxLines: maxLines, maxLines: maxLines,
overflow: textOnly ? TextOverflow.ellipsis : null, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: textColor, color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null, decoration: event.redacted ? TextDecoration.lineThrough : null,
), ),
); );
}
return LinkText(
text: senderPrefix + event.getBody(),
textStyle: TextStyle(
color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
);
case EventTypes.Emote: case EventTypes.Emote:
return Text( return Text(
"* " + event.getBody(), "* " + event.getBody(),

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: