refactor: Update flutter lints
This commit is contained in:
parent
b473f514ba
commit
35983437e2
15 changed files with 43 additions and 82 deletions
|
|
@ -69,7 +69,7 @@ enum AppSettings<T> {
|
|||
static SharedPreferences get store => _store!;
|
||||
static SharedPreferences? _store;
|
||||
|
||||
static Future<SharedPreferences> init({loadWebConfigFile = true}) async {
|
||||
static Future<SharedPreferences> init({bool loadWebConfigFile = true}) async {
|
||||
if (AppSettings._store != null) return AppSettings.store;
|
||||
|
||||
final store = AppSettings._store = await SharedPreferences.getInstance();
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
bool currentlyTyping = false;
|
||||
bool dragging = false;
|
||||
|
||||
void onDragEntered(_) => setState(() => dragging = true);
|
||||
void onDragEntered(dynamic _) => setState(() => dragging = true);
|
||||
|
||||
void onDragExited(_) => setState(() => dragging = false);
|
||||
void onDragExited(dynamic _) => setState(() => dragging = false);
|
||||
|
||||
void onDragDone(DropDoneDetails details) async {
|
||||
setState(() => dragging = false);
|
||||
|
|
@ -148,7 +148,8 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
MessageTypes.File,
|
||||
}.contains(selectedEvents.single.messageType);
|
||||
|
||||
void saveSelectedEvent(context) => selectedEvents.single.saveFile(context);
|
||||
void saveSelectedEvent(BuildContext context) =>
|
||||
selectedEvents.single.saveFile(context);
|
||||
|
||||
List<Event> selectedEvents = [];
|
||||
|
||||
|
|
@ -213,7 +214,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
context.go('/rooms');
|
||||
}
|
||||
|
||||
void requestHistory([_]) async {
|
||||
void requestHistory([dynamic _]) async {
|
||||
Logs().v('Requesting history...');
|
||||
await timeline?.requestHistory(historyCount: _loadHistoryCount);
|
||||
}
|
||||
|
|
@ -254,7 +255,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
void _shareItems([_]) {
|
||||
void _shareItems([dynamic _]) {
|
||||
final shareItems = widget.shareItems;
|
||||
if (shareItems == null || shareItems.isEmpty) return;
|
||||
if (!room.otherPartyCanReceiveMessages) {
|
||||
|
|
@ -1062,7 +1063,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
scrollController.jumpTo(0);
|
||||
}
|
||||
|
||||
void onEmojiSelected(_, Emoji? emoji) {
|
||||
void onEmojiSelected(dynamic _, Emoji? emoji) {
|
||||
typeEmoji(emoji);
|
||||
onInputBarChanged(sendController.text);
|
||||
}
|
||||
|
|
@ -1185,7 +1186,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
return index + 1;
|
||||
}
|
||||
|
||||
void onInputBarSubmitted(_) {
|
||||
void onInputBarSubmitted(String _) {
|
||||
send();
|
||||
FocusScope.of(context).requestFocus(inputFocus);
|
||||
}
|
||||
|
|
@ -1221,7 +1222,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
unpinEvent(String eventId) async {
|
||||
void unpinEvent(String eventId) async {
|
||||
final response = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context).unpin,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class _CuteContentState extends State<CuteContent> {
|
|||
Overlay.of(context).insert(overlay);
|
||||
}
|
||||
|
||||
generateLabel(User? user) {
|
||||
String? generateLabel(User? user) {
|
||||
switch (widget.event.content['cute_type']) {
|
||||
case 'googly_eyes':
|
||||
return L10n.of(context).googlyEyesContent(
|
||||
|
|
@ -90,6 +90,7 @@ class _CuteContentState extends State<CuteContent> {
|
|||
'',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class _StartPollBottomSheetState extends State<StartPollBottomSheet> {
|
|||
}
|
||||
}
|
||||
|
||||
void _updateCanCreate([_]) {
|
||||
void _updateCanCreate([dynamic _]) {
|
||||
final newCanCreate = _bodyController.text.trim().isNotEmpty &&
|
||||
!_answers.any((controller) => controller.text.trim().isEmpty);
|
||||
if (_canCreate != newCanCreate) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
|||
}
|
||||
}
|
||||
|
||||
void enableEncryption(_) async {
|
||||
void enableEncryption(dynamic _) async {
|
||||
if (room.encrypted) {
|
||||
showOkAlertDialog(
|
||||
context: context,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class ChatMembersController extends State<ChatMembersPage> {
|
|||
setFilter();
|
||||
}
|
||||
|
||||
void setFilter([_]) async {
|
||||
void setFilter([dynamic _]) async {
|
||||
final filter = filterController.text.toLowerCase().trim();
|
||||
|
||||
final members = this
|
||||
|
|
@ -56,7 +56,7 @@ class ChatMembersController extends State<ChatMembersPage> {
|
|||
});
|
||||
}
|
||||
|
||||
void refreshMembers([_]) async {
|
||||
void refreshMembers([dynamic _]) async {
|
||||
Logs().d('Load room members from', widget.roomId);
|
||||
try {
|
||||
setState(() {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class PIPViewState extends State<PIPView> with TickerProviderStateMixin {
|
|||
});
|
||||
}
|
||||
|
||||
void _onPanEnd(_) {
|
||||
void _onPanEnd(dynamic _) {
|
||||
if (!_isDragging) return;
|
||||
|
||||
final nearestCorner = _calculateNearestCorner(
|
||||
|
|
@ -128,7 +128,7 @@ class PIPViewState extends State<PIPView> with TickerProviderStateMixin {
|
|||
});
|
||||
}
|
||||
|
||||
void _onPanStart(_) {
|
||||
void _onPanStart(dynamic _) {
|
||||
if (_isAnimating()) return;
|
||||
setState(() {
|
||||
_dragOffset = _offsets[_corner]!;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class NewGroupController extends State<NewGroup> {
|
|||
context.pop<String>(spaceId);
|
||||
}
|
||||
|
||||
void submitAction([_]) async {
|
||||
void submitAction([dynamic _]) async {
|
||||
final client = Matrix.of(context).client;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class SettingsController extends State<Settings> {
|
|||
bool? crossSigningCached;
|
||||
bool? showChatBackupBanner;
|
||||
|
||||
void firstRunBootstrapAction([_]) async {
|
||||
void firstRunBootstrapAction([dynamic _]) async {
|
||||
if (showChatBackupBanner != true) {
|
||||
showOkAlertDialog(
|
||||
context: context,
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ class _EmojiImportPreviewState extends State<_EmojiImportPreview> {
|
|||
);
|
||||
}
|
||||
|
||||
_setRenderError() {
|
||||
void _setRenderError() {
|
||||
hasErrorNotifier.value = true;
|
||||
widget.onRemove.call();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
|||
WidgetsBinding.instance.addPostFrameCallback(_checkLoggedIn);
|
||||
}
|
||||
|
||||
void _checkLoggedIn(_) async {
|
||||
void _checkLoggedIn(dynamic _) async {
|
||||
if (widget.clients.any((client) => client.isLogged())) return;
|
||||
|
||||
await changePincode(null);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class ThemeController extends State<ThemeBuilder> {
|
|||
listen: false,
|
||||
);
|
||||
|
||||
void _loadData(_) async {
|
||||
void _loadData(dynamic _) async {
|
||||
final preferences =
|
||||
_sharedPreferences ??= await SharedPreferences.getInstance();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue