refactor: Enable more strict lints
This commit is contained in:
parent
f797bce8d0
commit
28af7bb0c7
65 changed files with 170 additions and 146 deletions
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class ConfigViewer extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _ConfigViewerState extends State<ConfigViewer> {
|
||||
void _changeSetting(
|
||||
Future<void> _changeSetting(
|
||||
AppSettings appSetting,
|
||||
SharedPreferences store,
|
||||
String initialValue,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class _MxcImageState extends State<MxcImage> {
|
|||
}
|
||||
}
|
||||
|
||||
void _tryLoad() async {
|
||||
Future<void> _tryLoad() async {
|
||||
if (_imageData != null) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: () {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class _ShareScaffoldDialogState extends State<ShareScaffoldDialog> {
|
|||
});
|
||||
}
|
||||
|
||||
void _forwardAction() async {
|
||||
Future<void> _forwardAction() async {
|
||||
final roomId = selectedRoomId;
|
||||
if (roomId == null) {
|
||||
throw Exception(
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue