build: Update to flutter 3.27

This commit is contained in:
Krille 2024-12-12 14:12:04 +01:00
commit dbe8c1b9f4
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
20 changed files with 81 additions and 152 deletions

View file

@ -818,7 +818,9 @@ class ChatController extends State<ChatPageWithRoom>
for (final event in selectedEvents) {
if (!event.status.isSent) return false;
if (event.canRedact == false &&
!(clients!.any((cl) => event.senderId == cl!.userID))) return false;
!(clients!.any((cl) => event.senderId == cl!.userID))) {
return false;
}
}
return true;
}

View file

@ -52,7 +52,7 @@ class ChatEmojiPicker extends StatelessWidget {
categoryViewConfig: CategoryViewConfig(
backspaceColor: theme.colorScheme.primary,
iconColor:
theme.colorScheme.primary.withOpacity(0.5),
theme.colorScheme.primary.withAlpha(128),
iconColorSelected: theme.colorScheme.primary,
indicatorColor: theme.colorScheme.primary,
),

View file

@ -364,7 +364,7 @@ class ChatView extends StatelessWidget {
),
if (controller.dragging)
Container(
color: theme.scaffoldBackgroundColor.withOpacity(0.9),
color: theme.scaffoldBackgroundColor.withAlpha(230),
alignment: Alignment.center,
child: const Icon(
Icons.upload_outlined,

View file

@ -5,7 +5,6 @@ import 'package:flutter_highlighter/flutter_highlighter.dart';
import 'package:flutter_highlighter/themes/shades-of-purple.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html_table/flutter_html_table.dart';
import 'package:flutter_math_fork/flutter_math.dart';
import 'package:html/dom.dart' as dom;
import 'package:linkify/linkify.dart';
import 'package:matrix/matrix.dart';
@ -133,9 +132,6 @@ class HtmlMessage extends StatelessWidget {
extensions: [
RoomPillExtension(context, room, fontSize, linkColor),
CodeExtension(fontSize: fontSize),
MatrixMathExtension(
style: TextStyle(fontSize: fontSize, color: textColor),
),
const TableHtmlExtension(),
SpoilerExtension(textColor: textColor),
const ImageExtension(),
@ -331,39 +327,6 @@ class SpoilerExtension extends HtmlExtension {
}
}
class MatrixMathExtension extends HtmlExtension {
final TextStyle? style;
MatrixMathExtension({this.style});
@override
Set<String> get supportedTags => {'div'};
@override
bool matches(ExtensionContext context) {
if (context.elementName != 'div') return false;
final mathData = context.element?.attributes['data-mx-maths'];
return mathData != null;
}
@override
InlineSpan build(ExtensionContext context) {
final data = context.element?.attributes['data-mx-maths'] ?? '';
return WidgetSpan(
child: Math.tex(
data,
textStyle: style,
onErrorFallback: (e) {
Logs().d('Flutter math parse error', e);
return Text(
data,
style: style,
);
},
),
);
}
}
class CodeExtension extends HtmlExtension {
final double fontSize;

View file

@ -39,7 +39,7 @@ class ReplyContent extends StatelessWidget {
return Material(
color: backgroundColor ??
theme.colorScheme.surface.withOpacity(ownMessage ? 0.2 : 0.33),
theme.colorScheme.surface.withAlpha(ownMessage ? 50 : 80),
borderRadius: borderRadius,
child: Row(
mainAxisSize: MainAxisSize.min,