fix for emojis not showing correctly in input bar
This commit is contained in:
parent
25d0fe2fb7
commit
f6a8583246
4 changed files with 31 additions and 28 deletions
|
|
@ -465,8 +465,9 @@ class InputBar extends StatelessWidget {
|
|||
// show suggestions after 50ms idle time (default is 300)
|
||||
// #Pangea
|
||||
key: controller!.choreographer.inputLayerLinkAndKey.key,
|
||||
// Pangea#
|
||||
builder: (context, controller, focusNode) => TextField(
|
||||
// builder: (context, controller, focusNode) => TextField(
|
||||
builder: (context, _, focusNode) => TextField(
|
||||
// Pangea#
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
contentInsertionConfiguration: ContentInsertionConfiguration(
|
||||
|
|
@ -494,9 +495,9 @@ class InputBar extends StatelessWidget {
|
|||
},
|
||||
// #Pangea
|
||||
onTap: () {
|
||||
this.controller!.onInputTap(
|
||||
controller!.onInputTap(
|
||||
context,
|
||||
fNode: focusNode,
|
||||
fNode: focusNode,
|
||||
);
|
||||
},
|
||||
// Pangea#
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/url_launcher.dart';
|
||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||
import '../../widgets/avatar.dart';
|
||||
|
||||
class StickerPickerDialog extends StatefulWidget {
|
||||
|
|
@ -130,15 +128,17 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(L10n.of(context)!.noEmotesFound),
|
||||
const SizedBox(height: 12),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => UrlLauncher(
|
||||
context,
|
||||
'https://matrix.to/#/#fluffychat-stickers:janian.de',
|
||||
).launchUrl(),
|
||||
icon: const Icon(Icons.explore_outlined),
|
||||
label: Text(L10n.of(context)!.discover),
|
||||
),
|
||||
// #Pangea
|
||||
// const SizedBox(height: 12),
|
||||
// OutlinedButton.icon(
|
||||
// onPressed: () => UrlLauncher(
|
||||
// context,
|
||||
// 'https://matrix.to/#/#fluffychat-stickers:janian.de',
|
||||
// ).launchUrl(),
|
||||
// icon: const Icon(Icons.explore_outlined),
|
||||
// label: Text(L10n.of(context)!.discover),
|
||||
// ),
|
||||
// Pangea#
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -943,6 +943,7 @@ extension PangeaRoom on Room {
|
|||
return (eventsDefaultPowerLevel ?? 0) >=
|
||||
ClassDefaultValues.powerLevelOfAdmin;
|
||||
}
|
||||
if (spaceChildren.isEmpty) return false;
|
||||
for (final child in spaceChildren) {
|
||||
if (child.roomId == null) continue;
|
||||
final Room? room = client.getRoomById(child.roomId!);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:fluffychat/pangea/models/pangea_token_model.dart';
|
|||
import 'package:fluffychat/pangea/models/span_card_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/utils/overlay.dart';
|
||||
import 'package:fluffychat/pangea/widgets/igc/span_card.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -12,7 +13,6 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
import '../constants/model_keys.dart';
|
||||
import '../widgets/igc/span_card.dart';
|
||||
import 'language_detection_model.dart';
|
||||
|
||||
// import 'package:language_tool/language_tool.dart';
|
||||
|
|
@ -285,10 +285,9 @@ class IGCTextData {
|
|||
|
||||
String matchText;
|
||||
try {
|
||||
matchText = originalInput.substring(
|
||||
matchTokens[tokenIndex].token.text.offset,
|
||||
matchTokens[nextTokenIndex - 1].token.end,
|
||||
);
|
||||
final int start = matchTokens[tokenIndex].token.text.offset;
|
||||
final int end = matchTokens[nextTokenIndex - 1].token.end;
|
||||
matchText = originalInput.characters.getRange(start, end).toString();
|
||||
} catch (err) {
|
||||
return [
|
||||
TextSpan(
|
||||
|
|
@ -318,12 +317,14 @@ class IGCTextData {
|
|||
),
|
||||
);
|
||||
|
||||
final String beforeNextToken = originalInput.substring(
|
||||
matchTokens[nextTokenIndex - 1].token.end,
|
||||
nextTokenIndex < matchTokens.length
|
||||
? matchTokens[nextTokenIndex].token.text.offset
|
||||
: originalInput.length,
|
||||
);
|
||||
final String beforeNextToken = originalInput.characters
|
||||
.getRange(
|
||||
matchTokens[nextTokenIndex - 1].token.end,
|
||||
nextTokenIndex < matchTokens.length
|
||||
? matchTokens[nextTokenIndex].token.text.offset
|
||||
: originalInput.length,
|
||||
)
|
||||
.toString();
|
||||
|
||||
if (beforeNextToken.isNotEmpty) {
|
||||
items.add(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue