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,

View file

@ -126,7 +126,7 @@ class PresenceAvatar extends StatelessWidget {
const statusMsgBubbleElevation = 6.0;
final statusMsgBubbleShadowColor = theme.colorScheme.surface;
final statusMsgBubbleColor = Colors.white.withOpacity(0.9);
final statusMsgBubbleColor = Colors.white.withAlpha(230);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: SizedBox(

View file

@ -60,7 +60,9 @@ class DevicesSettingsController extends State<DevicesSettings> {
message: L10n.of(context).removeDevicesDescription,
isDestructive: true,
) ==
OkCancelResult.cancel) return;
OkCancelResult.cancel) {
return;
}
final matrix = Matrix.of(context);
final deviceIds = <String>[];
for (final userDevice in devices) {

View file

@ -330,8 +330,6 @@ Map<PIPViewCorner, Offset> _calculateOffsets({
return Offset(left, bottom);
case PIPViewCorner.bottomRight:
return Offset(right, bottom);
default:
throw Exception('Not implemented.');
}
}

View file

@ -14,13 +14,13 @@ class ImageViewerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withAlpha(128),
extendBodyBehindAppBar: true,
appBar: AppBar(
elevation: 0,
leading: IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withAlpha(128),
),
icon: const Icon(Icons.close),
onPressed: Navigator.of(context).pop,
@ -31,7 +31,7 @@ class ImageViewerView extends StatelessWidget {
actions: [
IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withAlpha(128),
),
icon: const Icon(Icons.reply_outlined),
onPressed: controller.forwardAction,
@ -41,7 +41,7 @@ class ImageViewerView extends StatelessWidget {
const SizedBox(width: 8),
IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withAlpha(128),
),
icon: const Icon(Icons.download_outlined),
onPressed: () => controller.saveFileAction(context),
@ -56,7 +56,7 @@ class ImageViewerView extends StatelessWidget {
child: Builder(
builder: (context) => IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withAlpha(128),
),
onPressed: () => controller.shareFileAction(context),
tooltip: L10n.of(context).share,

View file

@ -10,6 +10,7 @@ import 'package:fluffychat/config/setting_keys.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat/events/state_message.dart';
import 'package:fluffychat/utils/account_config.dart';
import 'package:fluffychat/utils/color_value.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'package:fluffychat/widgets/matrix.dart';
@ -100,7 +101,7 @@ class SettingsStyleView extends StatelessWidget {
child: Tooltip(
message: color == null
? L10n.of(context).systemTheme
: '#${color.value.toRadixString(16).toUpperCase()}',
: '#${color.hexValue.toRadixString(16).toUpperCase()}',
child: InkWell(
borderRadius: BorderRadius.circular(colorPickerSize),
onTap: () => controller.setChatColor(color),