refactor: Update to Flutter 3.13.0
This commit is contained in:
parent
6445833283
commit
27d15612d9
44 changed files with 167 additions and 159 deletions
|
|
@ -30,7 +30,7 @@ class ArchiveView extends StatelessWidget {
|
|||
label: Text(L10n.of(context)!.clearArchive),
|
||||
icon: const Icon(Icons.cleaning_services_outlined),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
setState(() => _createBootstrap(true));
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class AddWidgetTileView extends StatelessWidget {
|
|||
child: Text(L10n.of(context)!.addWidget),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
MatrixImageFile(
|
||||
bytes: bytes,
|
||||
name: file.path,
|
||||
)
|
||||
),
|
||||
],
|
||||
room: room,
|
||||
),
|
||||
|
|
@ -568,7 +568,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
MatrixVideoFile(
|
||||
bytes: bytes,
|
||||
name: file.path,
|
||||
)
|
||||
),
|
||||
],
|
||||
room: room,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class ChatInputRow extends StatelessWidget {
|
|||
KeyBoardShortcuts(
|
||||
keysToPress: {
|
||||
LogicalKeyboardKey.altLeft,
|
||||
LogicalKeyboardKey.keyA
|
||||
LogicalKeyboardKey.keyA,
|
||||
},
|
||||
onKeysPressed: () =>
|
||||
controller.onAddPopupMenuButtonSelected('file'),
|
||||
|
|
@ -184,7 +184,7 @@ class ChatInputRow extends StatelessWidget {
|
|||
child: KeyBoardShortcuts(
|
||||
keysToPress: {
|
||||
LogicalKeyboardKey.altLeft,
|
||||
LogicalKeyboardKey.keyE
|
||||
LogicalKeyboardKey.keyE,
|
||||
},
|
||||
onKeysPressed: controller.emojiPickerAction,
|
||||
helpLabel: L10n.of(context)!.emojis,
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class ChatView extends StatelessWidget {
|
|||
icon: const Icon(Icons.delete_forever_outlined),
|
||||
label: Text(L10n.of(context)!.delete),
|
||||
),
|
||||
)
|
||||
),
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class _CuteContentState extends State<CuteContent> {
|
|||
widget.event.text,
|
||||
style: const TextStyle(fontSize: 150),
|
||||
),
|
||||
if (label != null) Text(label)
|
||||
if (label != null) Text(label),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Message extends StatelessWidget {
|
|||
EventTypes.Message,
|
||||
EventTypes.Sticker,
|
||||
EventTypes.Encrypted,
|
||||
EventTypes.CallInvite
|
||||
EventTypes.CallInvite,
|
||||
}.contains(event.type)) {
|
||||
if (event.type.startsWith('m.call.')) {
|
||||
return const SizedBox.shrink();
|
||||
|
|
@ -103,7 +103,7 @@ class Message extends StatelessWidget {
|
|||
final noBubble = {
|
||||
MessageTypes.Video,
|
||||
MessageTypes.Image,
|
||||
MessageTypes.Sticker
|
||||
MessageTypes.Sticker,
|
||||
}.contains(event.messageType) &&
|
||||
!event.redacted;
|
||||
final noPadding = {
|
||||
|
|
@ -222,7 +222,7 @@ class Message extends StatelessWidget {
|
|||
eventId: event.relationshipEventId!,
|
||||
content: {
|
||||
'msgtype': 'm.text',
|
||||
'body': '...'
|
||||
'body': '...',
|
||||
},
|
||||
senderId: event.senderId,
|
||||
type: 'm.room.message',
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class MessageContent extends StatelessWidget {
|
|||
event.calcLocalizedBodyFallback(
|
||||
MatrixLocals(l10n),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class MessageDownloadContent extends StatelessWidget {
|
|||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ class _AdaptableReactorsDialog extends StatelessWidget {
|
|||
runSpacing: 4.0,
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
for (var reactor in reactionEntry!.reactors!)
|
||||
for (final reactor in reactionEntry!.reactors!)
|
||||
Chip(
|
||||
avatar: Avatar(
|
||||
mxContent: reactor.avatarUrl,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class VerificationRequestContent extends StatelessWidget {
|
|||
: (started
|
||||
? L10n.of(context)!.loadingPleaseWait
|
||||
: L10n.of(context)!.newVerificationRequest)),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ class InputBar extends StatelessWidget {
|
|||
LogicalKeySet(
|
||||
LogicalKeyboardKey.controlLeft,
|
||||
LogicalKeyboardKey.keyM,
|
||||
): PasteLineIntent()
|
||||
): PasteLineIntent(),
|
||||
},
|
||||
child: Actions(
|
||||
actions: !useShortCuts
|
||||
|
|
@ -443,7 +443,7 @@ class InputBar extends StatelessWidget {
|
|||
}
|
||||
return null;
|
||||
},
|
||||
)
|
||||
),
|
||||
},
|
||||
child: TypeAheadField<Map<String, String?>>(
|
||||
direction: AxisDirection.up,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class ReactionsPicker extends StatelessWidget {
|
|||
),
|
||||
onTap: () =>
|
||||
controller.pickEmojiReactionAction(allReactionEvents),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|||
child: Text('${L10n.of(context)!.sendOriginal} ($sizeString)'),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class ChatDetailsController extends State<ChatDetails> {
|
|||
L10n.of(context)!,
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
|
|
@ -184,7 +184,7 @@ class ChatDetailsController extends State<ChatDetails> {
|
|||
suffixText: domain,
|
||||
hintText: L10n.of(context)!.alias,
|
||||
initialText: room.canonicalAlias.localpart,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
|
|
@ -208,7 +208,7 @@ class ChatDetailsController extends State<ChatDetails> {
|
|||
initialText: room.topic,
|
||||
minLines: 4,
|
||||
maxLines: 8,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
context,
|
||||
),
|
||||
),
|
||||
ChatSettingsPopupMenu(room, false)
|
||||
ChatSettingsPopupMenu(room, false),
|
||||
],
|
||||
title: Text(L10n.of(context)!.chatDetails),
|
||||
backgroundColor:
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ class ChatListController extends State<ChatList>
|
|||
validator: (server) => server?.contains('.') == true
|
||||
? null
|
||||
: L10n.of(context)!.invalidServerName,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (newServer == null) return;
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class ChatListView extends StatelessWidget {
|
|||
floatingActionButton: KeyBoardShortcuts(
|
||||
keysToPress: {
|
||||
LogicalKeyboardKey.controlLeft,
|
||||
LogicalKeyboardKey.keyN
|
||||
LogicalKeyboardKey.keyN,
|
||||
},
|
||||
onKeysPressed: () => context.go('/rooms/newprivatechat'),
|
||||
helpLabel: L10n.of(context)!.newChat,
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
KeyBoardShortcuts(
|
||||
keysToPress: {
|
||||
LogicalKeyboardKey.controlLeft,
|
||||
LogicalKeyboardKey.tab
|
||||
LogicalKeyboardKey.tab,
|
||||
},
|
||||
helpLabel: L10n.of(context)!.nextAccount,
|
||||
onKeysPressed: () => _nextAccount(matrix, context),
|
||||
|
|
@ -205,7 +205,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
keysToPress: {
|
||||
LogicalKeyboardKey.controlLeft,
|
||||
LogicalKeyboardKey.shiftLeft,
|
||||
LogicalKeyboardKey.tab
|
||||
LogicalKeyboardKey.tab,
|
||||
},
|
||||
helpLabel: L10n.of(context)!.previousAccount,
|
||||
onKeysPressed: () => _previousAccount(matrix, context),
|
||||
|
|
@ -235,7 +235,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
if (index > 0 && index < 10) {
|
||||
return {
|
||||
LogicalKeyboardKey.altLeft,
|
||||
LogicalKeyboardKey(0x00000000030 + index)
|
||||
LogicalKeyboardKey(0x00000000030 + index),
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
IconButton(
|
||||
onPressed: _refresh,
|
||||
icon: const Icon(Icons.refresh_outlined),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ class _StoryButtonState extends State<_StoryButton> {
|
|||
],
|
||||
),
|
||||
),
|
||||
]
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (var entry in powerLevels.entries)
|
||||
for (final entry in powerLevels.entries)
|
||||
PermissionsListTile(
|
||||
permissionKey: entry.key,
|
||||
permission: entry.value,
|
||||
|
|
@ -95,7 +95,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
for (var entry in eventsPowerLevels.entries)
|
||||
for (final entry in eventsPowerLevels.entries)
|
||||
PermissionsListTile(
|
||||
permissionKey: entry.key,
|
||||
category: 'events',
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class DevicesSettingsController extends State<DevicesSettings> {
|
|||
textFields: [
|
||||
DialogTextField(
|
||||
hintText: device.displayName,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (displayName == null) return;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class _StreamView extends StatelessWidget {
|
|||
color: Colors.white,
|
||||
size: 18.0,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
@ -503,7 +503,7 @@ class MyCallingPage extends State<Calling> {
|
|||
color: Colors.white,
|
||||
fontSize: 24.0,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -639,7 +639,7 @@ class MyCallingPage extends State<Calling> {
|
|||
PIPView.of(context)?.setFloating(true);
|
||||
},
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ImageViewerView extends StatelessWidget {
|
|||
color: Colors.white,
|
||||
icon: Icon(Icons.adaptive.share_outlined),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
body: InteractiveViewer(
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
const SizedBox(height: 16),
|
||||
Text(
|
||||
L10n.of(context)!.askVerificationRequest(displayName),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
buttons.add(
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
TextStyle(color: Theme.of(context).colorScheme.secondary),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class SettingsController extends State<Settings> {
|
|||
DialogTextField(
|
||||
initialText: profile?.displayName ??
|
||||
Matrix.of(context).client.userID!.localpart,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Settings3PidView extends StatelessWidget {
|
|||
icon: const Icon(Icons.add_outlined),
|
||||
onPressed: controller.add3PidAction,
|
||||
tooltip: L10n.of(context)!.addEmail,
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ class _EmojiImportPreviewState extends State<_EmojiImportPreview> {
|
|||
child: TextField(
|
||||
controller: controller,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'^[-\w]+$'))
|
||||
FilteringTextInputFormatter.allow(RegExp(r'^[-\w]+$')),
|
||||
],
|
||||
autocorrect: false,
|
||||
minLines: 1,
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class SettingsNotificationsController extends State<SettingsNotifications> {
|
|||
label: L10n.of(context)!.delete,
|
||||
isDestructiveAction: true,
|
||||
key: true,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (delete != true) return;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
for (var item in NotificationSettingsItem.items)
|
||||
for (final item in NotificationSettingsItem.items)
|
||||
SwitchListTile.adaptive(
|
||||
value: controller.getNotificationSetting(item) ?? true,
|
||||
title: Text(item.title(context)),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
obscureText: true,
|
||||
maxLines: 1,
|
||||
minLines: 1,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (newLock != null) {
|
||||
|
|
@ -142,7 +142,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
hintText: '******',
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ class CustomScrollBehavior extends MaterialScrollBehavior {
|
|||
Set<PointerDeviceKind> get dragDevices => {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
PointerDeviceKind.trackpad
|
||||
PointerDeviceKind.trackpad,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ extension IsStateExtension on Event {
|
|||
bool get isState => !{
|
||||
EventTypes.Message,
|
||||
EventTypes.Sticker,
|
||||
EventTypes.Encrypted
|
||||
EventTypes.Encrypted,
|
||||
}.contains(type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ extension UiaRequestManager on MatrixState {
|
|||
maxLines: 1,
|
||||
obscureText: true,
|
||||
hintText: '******',
|
||||
)
|
||||
),
|
||||
],
|
||||
))
|
||||
?.single;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
|||
KeyBoardShortcuts(
|
||||
keysToPress: {
|
||||
LogicalKeyboardKey.controlLeft,
|
||||
LogicalKeyboardKey.keyI
|
||||
LogicalKeyboardKey.keyI,
|
||||
},
|
||||
helpLabel: L10n.of(context)!.chatDetails,
|
||||
onKeysPressed: _showChatDetails,
|
||||
|
|
|
|||
|
|
@ -229,8 +229,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
bool webHasFocus = true;
|
||||
|
||||
String? get activeRoomId {
|
||||
final route = FluffyChatApp.router.routeInformationProvider.value.location;
|
||||
if (route == null || !route.startsWith('/rooms/')) return null;
|
||||
final route = FluffyChatApp.router.routeInformationProvider.value.uri.path;
|
||||
if (!route.startsWith('/rooms/')) return null;
|
||||
return route.split('/')[2];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Future<int?> showPermissionChooser(
|
|||
initialText: currentLevel.toString(),
|
||||
keyboardType: TextInputType.number,
|
||||
autocorrect: false,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
if (customLevel == null) return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue