Merge commit 'c52209ccdd5a2cc0558244bfe3b29909e5e937f5' into fluffychat-merge
This commit is contained in:
commit
3968f17e75
5 changed files with 33 additions and 24 deletions
2
.github/workflows/versions.env
vendored
2
.github/workflows/versions.env
vendored
|
|
@ -1,2 +1,2 @@
|
|||
FLUTTER_VERSION=3.32.0
|
||||
FLUTTER_VERSION=3.32.1
|
||||
JAVA_VERSION=17
|
||||
|
|
|
|||
|
|
@ -1780,14 +1780,6 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
if (choice == 'location') {
|
||||
sendLocationAction();
|
||||
}
|
||||
if (choice == 'checklist') {
|
||||
if (sendController.text.isEmpty) {
|
||||
sendController.text = '- [ ] ';
|
||||
} else {
|
||||
sendController.text += '\n- [ ] ';
|
||||
}
|
||||
inputFocus.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
unpinEvent(String eventId) async {
|
||||
|
|
|
|||
|
|
@ -124,18 +124,6 @@ class ChatInputRow extends StatelessWidget {
|
|||
onSelected: controller.onAddPopupMenuButtonSelected,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
PopupMenuItem<String>(
|
||||
value: 'checklist',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: theme.colorScheme.onPrimaryContainer,
|
||||
foregroundColor: theme.colorScheme.primaryContainer,
|
||||
child: const Icon(Icons.check_circle_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context).checkList),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
if (PlatformInfos.isMobile)
|
||||
PopupMenuItem<String>(
|
||||
value: 'location',
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
|
@ -508,12 +509,11 @@ class HtmlMessage extends StatelessWidget {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: SizedBox.square(
|
||||
dimension: fontSize,
|
||||
child: Checkbox.adaptive(
|
||||
dimension: fontSize + 2,
|
||||
child: CupertinoCheckbox(
|
||||
checkColor: textColor,
|
||||
side: BorderSide(color: textColor),
|
||||
activeColor: textColor.withAlpha(64),
|
||||
visualDensity: VisualDensity.compact,
|
||||
value:
|
||||
staticallyChecked || checkedByReaction != null,
|
||||
onChanged: eventId == null ||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,35 @@ Widget markdownContextBuilder(
|
|||
ContextMenuController.removeAny();
|
||||
},
|
||||
),
|
||||
ContextMenuButtonItem(
|
||||
label: l10n.checkList,
|
||||
onPressed: () {
|
||||
final text = controller.text;
|
||||
final selection = controller.selection;
|
||||
|
||||
var start = selection.textBefore(text).lastIndexOf('\n');
|
||||
if (start == -1) start = 0;
|
||||
final end = selection.end;
|
||||
|
||||
final fullLineSelection =
|
||||
TextSelection(baseOffset: start, extentOffset: end);
|
||||
|
||||
const checkBox = '- [ ]';
|
||||
|
||||
final replacedRange = fullLineSelection
|
||||
.textInside(text)
|
||||
.split('\n')
|
||||
.map(
|
||||
(line) => line.startsWith(checkBox) || line.isEmpty
|
||||
? line
|
||||
: '$checkBox $line',
|
||||
)
|
||||
.join('\n');
|
||||
controller.text =
|
||||
controller.text.replaceRange(start, end, replacedRange);
|
||||
ContextMenuController.removeAny();
|
||||
},
|
||||
),
|
||||
ContextMenuButtonItem(
|
||||
label: l10n.boldText,
|
||||
onPressed: () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue