refactor: Enable rule avoid dynamic
This commit is contained in:
parent
298a2d0760
commit
9d007815df
17 changed files with 41 additions and 35 deletions
|
|
@ -117,9 +117,9 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
bool currentlyTyping = false;
|
||||
bool dragging = false;
|
||||
|
||||
void onDragEntered(dynamic _) => setState(() => dragging = true);
|
||||
void onDragEntered(_) => setState(() => dragging = true);
|
||||
|
||||
void onDragExited(dynamic _) => setState(() => dragging = false);
|
||||
void onDragExited(_) => setState(() => dragging = false);
|
||||
|
||||
void onDragDone(DropDoneDetails details) async {
|
||||
setState(() => dragging = false);
|
||||
|
|
@ -213,7 +213,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
context.go('/rooms');
|
||||
}
|
||||
|
||||
void requestHistory([dynamic _]) async {
|
||||
void requestHistory([_]) async {
|
||||
Logs().v('Requesting history...');
|
||||
await timeline?.requestHistory(historyCount: _loadHistoryCount);
|
||||
}
|
||||
|
|
@ -265,7 +265,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
void _shareItems([dynamic _]) {
|
||||
void _shareItems([_]) {
|
||||
final shareItems = widget.shareItems;
|
||||
if (shareItems == null || shareItems.isEmpty) return;
|
||||
if (!room.otherPartyCanReceiveMessages) {
|
||||
|
|
@ -1053,7 +1053,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
scrollController.jumpTo(0);
|
||||
}
|
||||
|
||||
void onEmojiSelected(dynamic _, Emoji? emoji) {
|
||||
void onEmojiSelected(_, Emoji? emoji) {
|
||||
typeEmoji(emoji);
|
||||
onInputBarChanged(sendController.text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
setState(() => status = AudioPlayerStatus.downloading);
|
||||
try {
|
||||
final fileSize = widget.event.content
|
||||
.tryGetMap<String, dynamic>('info')
|
||||
.tryGetMap<String, Object?>('info')
|
||||
?.tryGet<int>('size');
|
||||
matrixFile = await widget.event.downloadAndDecryptAttachment(
|
||||
onDownloadProgress: fileSize != null && fileSize > 0
|
||||
|
|
@ -242,7 +242,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
|
||||
List<int>? _getWaveform() {
|
||||
final eventWaveForm = widget.event.content
|
||||
.tryGetMap<String, dynamic>('org.matrix.msc1767.audio')
|
||||
.tryGetMap<String, Object?>('org.matrix.msc1767.audio')
|
||||
?.tryGetList<int>('waveform');
|
||||
if (eventWaveForm == null || eventWaveForm.isEmpty) {
|
||||
return null;
|
||||
|
|
@ -275,7 +275,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
}
|
||||
|
||||
final durationInt = widget.event.content
|
||||
.tryGetMap<String, dynamic>('info')
|
||||
.tryGetMap<String, Object?>('info')
|
||||
?.tryGet<int>('duration');
|
||||
if (durationInt != null) {
|
||||
final duration = Duration(milliseconds: durationInt);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class MessageDownloadContent extends StatelessWidget {
|
|||
final filetype = (filename.contains('.')
|
||||
? filename.split('.').last.toUpperCase()
|
||||
: event.content
|
||||
.tryGetMap<String, dynamic>('info')
|
||||
.tryGetMap<String, Object?>('info')
|
||||
?.tryGet<String>('mimetype')
|
||||
?.toUpperCase() ??
|
||||
'UNKNOWN');
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class MessageReactions extends StatelessWidget {
|
|||
|
||||
for (final e in allReactionEvents) {
|
||||
final key = e.content
|
||||
.tryGetMap<String, dynamic>('m.relates_to')
|
||||
.tryGetMap<String, Object?>('m.relates_to')
|
||||
?.tryGet<String>('key');
|
||||
if (key != null) {
|
||||
if (!reactionMap.containsKey(key)) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class _StartPollBottomSheetState extends State<StartPollBottomSheet> {
|
|||
}
|
||||
}
|
||||
|
||||
void _updateCanCreate([dynamic _]) {
|
||||
void _updateCanCreate([_]) {
|
||||
final newCanCreate =
|
||||
_bodyController.text.trim().isNotEmpty &&
|
||||
!_answers.any((controller) => controller.text.trim().isEmpty);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue