refactor: Enable more strict lints

This commit is contained in:
Christian Kußowski 2026-02-24 10:04:40 +01:00
commit 28af7bb0c7
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
65 changed files with 170 additions and 146 deletions

View file

@ -23,7 +23,7 @@ class PublicRoomDialog extends StatelessWidget {
const PublicRoomDialog({super.key, this.roomAlias, this.chunk, this.via});
void _joinRoom(BuildContext context) async {
Future<void> _joinRoom(BuildContext context) async {
final client = Matrix.of(context).client;
final chunk = this.chunk;
final knock = chunk?.joinRule == 'knock';

View file

@ -41,7 +41,7 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback(_checkLoggedIn);
}
void _checkLoggedIn(_) async {
Future<void> _checkLoggedIn(_) async {
if (widget.clients.any((client) => client.isLogged())) return;
await changePincode(null);

View file

@ -16,7 +16,7 @@ class ConfigViewer extends StatefulWidget {
}
class _ConfigViewerState extends State<ConfigViewer> {
void _changeSetting(
Future<void> _changeSetting(
AppSettings appSetting,
SharedPreferences store,
String initialValue,

View file

@ -22,7 +22,7 @@ extension LocalNotificationsExtension on MatrixState {
..src = 'assets/assets/sounds/notification.ogg'
..load();
void showLocalNotification(Event event) async {
Future<void> showLocalNotification(Event event) async {
final roomId = event.room.id;
if (activeRoomId == roomId) {
if (WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {

View file

@ -20,7 +20,7 @@ class _LockScreenState extends State<LockScreen> {
bool _inputBlocked = false;
final TextEditingController _textEditingController = TextEditingController();
void tryUnlock(String text) async {
Future<void> tryUnlock(String text) async {
text = text.trim();
setState(() {
_errorText = null;

View file

@ -81,10 +81,10 @@ extension on LogEvent {
String toDisplayString() {
var str = '# [${level.toString().split('.').last.toUpperCase()}] $title';
if (exception != null) {
str += ' - ${exception.toString()}';
str += ' - $exception';
}
if (stackTrace != null) {
str += '\n${stackTrace.toString()}';
str += '\n$stackTrace';
}
return str;
}

View file

@ -342,7 +342,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
createVoipPlugin();
}
void createVoipPlugin() async {
Future<void> createVoipPlugin() async {
if (AppSettings.experimentalVoip.value) {
voipPlugin = null;
return;

View file

@ -10,7 +10,7 @@ import 'adaptive_dialogs/user_dialog.dart';
import 'avatar.dart';
import 'future_loading_dialog.dart';
void showMemberActionsPopupMenu({
Future<void> showMemberActionsPopupMenu({
required BuildContext context,
required User user,
void Function()? onMention,

View file

@ -109,7 +109,7 @@ class _MxcImageState extends State<MxcImage> {
}
}
void _tryLoad() async {
Future<void> _tryLoad() async {
if (_imageData != null) {
return;
}

View file

@ -24,7 +24,7 @@ class QrCodeViewer extends StatelessWidget {
const QrCodeViewer({required this.content, super.key});
void _save(BuildContext context) async {
Future<void> _save(BuildContext context) async {
final imageResult = await showFutureLoadingDialog(
context: context,
future: () {

View file

@ -48,7 +48,7 @@ class _ShareScaffoldDialogState extends State<ShareScaffoldDialog> {
});
}
void _forwardAction() async {
Future<void> _forwardAction() async {
final roomId = selectedRoomId;
if (roomId == null) {
throw Exception(

View file

@ -41,7 +41,7 @@ class ThemeController extends State<ThemeBuilder> {
static ThemeController of(BuildContext context) =>
Provider.of<ThemeController>(context, listen: false);
void _loadData(_) async {
Future<void> _loadData(_) async {
final preferences = _sharedPreferences ??=
await SharedPreferences.getInstance();