diff --git a/lib/third_party/linkify/flutter_linkify.dart b/lib/third_party/linkify/flutter_linkify.dart index 9f5d8e0e..8aa51542 100644 --- a/lib/third_party/linkify/flutter_linkify.dart +++ b/lib/third_party/linkify/flutter_linkify.dart @@ -359,12 +359,7 @@ TextSpan buildTextSpan( message: element.url, inlineSpan: LinkableSpan( mouseCursor: SystemMouseCursors.click, - inlineSpan: TextSpan( - text: element.text, - style: linkStyle, - recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null, - semanticsLabel: element.text - ), + inlineSpan: TextSpan(text: element.text, style: linkStyle, recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null, semanticsLabel: element.text), )); } else { return TooltipSpan( @@ -376,56 +371,41 @@ TextSpan buildTextSpan( )); } } else if (element is BoldElement) { - return TextSpan( - text: element.text.replaceAll("*", ""), - style: style?.copyWith(fontWeight: FontWeight.bold), - semanticsLabel: element.text - - ); + return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontWeight: FontWeight.bold), semanticsLabel: element.text); } else if (element is ItalicElement) { - return TextSpan( - text: element.text.replaceAll("*", ""), - style: style?.copyWith(fontStyle: FontStyle.italic), - semanticsLabel: element.text - ); + return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontStyle: FontStyle.italic), semanticsLabel: element.text); } else if (element is SuperElement) { return WidgetSpan( child: Transform.translate( offset: const Offset(2, -6), - child: Text( - element.text.replaceAll("^", ""), - //superscript is usually smaller in size - textScaleFactor: 0.7, - style: style, - semanticsLabel: element.text - ), + child: Text(element.text.replaceAll("^", ""), + //superscript is usually smaller in size + textScaleFactor: 0.7, + style: style, + semanticsLabel: element.text), )); } else if (element is SubElement) { return WidgetSpan( child: Transform.translate( offset: const Offset(2, 4), - child: Text( - element.text.replaceAll("_", ""), - //superscript is usually smaller in size - textScaleFactor: 0.7, - style: style, - semanticsLabel: element.text - ), + child: Text(element.text.replaceAll("_", ""), + //superscript is usually smaller in size + textScaleFactor: 0.7, + style: style, + semanticsLabel: element.text), )); } else if (element is StrikeElement) { return TextSpan( - text: element.text.replaceAll("~~", ""), - style: style?.copyWith(decoration: TextDecoration.lineThrough, decorationColor: style.color, decorationStyle: TextDecorationStyle.solid), - semanticsLabel: element.text - ); + text: element.text.replaceAll("~~", ""), + style: style?.copyWith(decoration: TextDecoration.lineThrough, decorationColor: style.color, decorationStyle: TextDecorationStyle.solid), + semanticsLabel: element.text); } else if (element is CodeElement) { return TextSpan( - text: element.text.replaceAll("\`", ""), - // monospace fonts at the same size as regular text makes them appear - // slightly larger, so we compensate by making them slightly smaller... - style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize!-1.0), - semanticsLabel: element.text - ); + text: element.text.replaceAll("\`", ""), + // monospace fonts at the same size as regular text makes them appear + // slightly larger, so we compensate by making them slightly smaller... + style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize! - 1.0), + semanticsLabel: element.text); } else { return TextSpan( text: element.text, diff --git a/lib/third_party/linkify/uri.dart b/lib/third_party/linkify/uri.dart index 57b4bbc0..89808789 100644 --- a/lib/third_party/linkify/uri.dart +++ b/lib/third_party/linkify/uri.dart @@ -25,6 +25,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +import 'package:cwtch/config.dart'; + import 'linkify.dart'; final _urlRegex = RegExp( @@ -209,7 +211,9 @@ class UrlLinkifier extends Linkifier { // we can jump straight to message formatting... list.addAll(parseFormatting(element, options)); } else { - // unreachable + // unreachable - if we get here then there is something wrong in the above logic since every combination of + // formatting options should have already been accounted for. + EnvironmentConfig.debugLog("'unreachable' code path in formatting has been triggered. this is very likely a bug - please report $options"); } } }); diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 14cbbd13..1724e6b6 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -40,7 +40,9 @@ void selectConversation(BuildContext context, int handle) { var isLandscape = Provider.of(context, listen: false).isLandscape(context); if (Provider.of(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle); // Set last message seen time in backend - Provider.of(context, listen: false).cwtch.SetConversationAttribute(Provider.of(context, listen: false).onion, handle, LastMessageSeenTimeKey, DateTime.now().toUtc().toIso8601String()); + Provider.of(context, listen: false) + .cwtch + .SetConversationAttribute(Provider.of(context, listen: false).onion, handle, LastMessageSeenTimeKey, DateTime.now().toUtc().toIso8601String()); } void _pushMessageView(BuildContext context, int handle) { diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 5a097d6f..806d9486 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -384,7 +384,7 @@ class _GlobalSettingsViewState extends State { }, activeTrackColor: settings.theme.defaultButtonActiveColor, inactiveTrackColor: settings.theme.defaultButtonDisabledColor, - secondary: Icon(Icons.link, color: settings.current().mainTextColor), + secondary: Icon(Icons.text_fields, color: settings.current().mainTextColor), )), AboutListTile( icon: appIcon,