🎨 Fix most of linting notes
This commit is contained in:
@ -32,7 +32,7 @@ class _AccountSelectState extends State<AccountSelect> {
|
||||
final List<SnAccount> _pendingUsers = List.empty(growable: true);
|
||||
final List<SnAccount> _selectedUsers = List.empty(growable: true);
|
||||
|
||||
int _accountId = 0;
|
||||
final int _accountId = 0;
|
||||
|
||||
Future<void> _revertSelectedUsers() async {
|
||||
if (widget.initialSelection?.isEmpty ?? true) return;
|
||||
|
@ -80,7 +80,7 @@ class _AttachmentItemSensitiveBlur extends StatefulWidget {
|
||||
final Widget child;
|
||||
final bool isCompact;
|
||||
|
||||
const _AttachmentItemSensitiveBlur({super.key, required this.child, this.isCompact = false});
|
||||
const _AttachmentItemSensitiveBlur({required this.child, this.isCompact = false});
|
||||
|
||||
@override
|
||||
State<_AttachmentItemSensitiveBlur> createState() => _AttachmentItemSensitiveBlurState();
|
||||
@ -166,7 +166,6 @@ class _AttachmentItemContentVideo extends StatefulWidget {
|
||||
final bool isAutoload;
|
||||
|
||||
const _AttachmentItemContentVideo({
|
||||
super.key,
|
||||
required this.data,
|
||||
this.isAutoload = false,
|
||||
});
|
||||
@ -207,7 +206,7 @@ class _AttachmentItemContentVideoState extends State<_AttachmentItemContentVideo
|
||||
),
|
||||
];
|
||||
|
||||
final ratio = widget.data.metadata['ratio'] ?? 16 / 9;
|
||||
final ratio = widget.data.data['ratio'] ?? 16 / 9;
|
||||
|
||||
final sn = context.read<SnNetworkProvider>();
|
||||
|
||||
@ -216,9 +215,9 @@ class _AttachmentItemContentVideoState extends State<_AttachmentItemContentVideo
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Stack(
|
||||
children: [
|
||||
if (widget.data.metadata['thumbnail'] != null)
|
||||
if (widget.data.thumbnail != null)
|
||||
AutoResizeUniversalImage(
|
||||
sn.getAttachmentUrl(widget.data.metadata['thumbnail']),
|
||||
sn.getAttachmentUrl(widget.data.thumbnail!),
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
else
|
||||
@ -266,7 +265,7 @@ class _AttachmentItemContentVideoState extends State<_AttachmentItemContentVideo
|
||||
),
|
||||
Text(
|
||||
Duration(
|
||||
milliseconds: (widget.data.metadata['duration'] ?? 0).toInt() * 1000,
|
||||
milliseconds: (widget.data.data['duration'] ?? 0).toInt() * 1000,
|
||||
).toString(),
|
||||
style: GoogleFonts.robotoMono(
|
||||
fontSize: 12,
|
||||
@ -316,7 +315,6 @@ class _AttachmentItemContentAudio extends StatefulWidget {
|
||||
final bool isAutoload;
|
||||
|
||||
const _AttachmentItemContentAudio({
|
||||
super.key,
|
||||
required this.data,
|
||||
this.isAutoload = false,
|
||||
});
|
||||
@ -374,11 +372,11 @@ class _AttachmentItemContentAudioState extends State<_AttachmentItemContentAudio
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Stack(
|
||||
children: [
|
||||
if (widget.data.metadata['thumbnail'] != null)
|
||||
if (widget.data.thumbnail != null)
|
||||
AspectRatio(
|
||||
aspectRatio: 16 / 9,
|
||||
child: AutoResizeUniversalImage(
|
||||
sn.getAttachmentUrl(widget.data.metadata['thumbnail']),
|
||||
sn.getAttachmentUrl(widget.data.data['thumbnail']),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
@ -459,11 +457,11 @@ class _AttachmentItemContentAudioState extends State<_AttachmentItemContentAudio
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
if (widget.data.metadata['thumbnail'] != null)
|
||||
if (widget.data.data['thumbnail'] != null)
|
||||
AspectRatio(
|
||||
aspectRatio: 16 / 9,
|
||||
child: AutoResizeUniversalImage(
|
||||
sn.getAttachmentUrl(widget.data.metadata['thumbnail']),
|
||||
sn.getAttachmentUrl(widget.data.data['thumbnail']),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
@ -174,7 +174,7 @@ class ChatMessage extends StatelessWidget {
|
||||
class _ChatMessageText extends StatelessWidget {
|
||||
final SnChatMessage data;
|
||||
|
||||
const _ChatMessageText({super.key, required this.data});
|
||||
const _ChatMessageText({required this.data});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -214,7 +214,7 @@ class _ChatMessageText extends StatelessWidget {
|
||||
class _ChatMessageSystemNotify extends StatelessWidget {
|
||||
final SnChatMessage data;
|
||||
|
||||
const _ChatMessageSystemNotify({super.key, required this.data});
|
||||
const _ChatMessageSystemNotify({required this.data});
|
||||
|
||||
String _formatDuration(Duration duration) {
|
||||
String negativeSign = duration.isNegative ? '-' : '';
|
||||
|
@ -60,7 +60,6 @@ class _LinkPreviewEntry extends StatelessWidget {
|
||||
final SnLinkMeta meta;
|
||||
|
||||
const _LinkPreviewEntry({
|
||||
super.key,
|
||||
required this.meta,
|
||||
});
|
||||
|
||||
|
@ -549,7 +549,6 @@ class _PostHeadline extends StatelessWidget {
|
||||
final bool isEnlarge;
|
||||
|
||||
const _PostHeadline({
|
||||
super.key,
|
||||
required this.data,
|
||||
this.isEnlarge = false,
|
||||
});
|
||||
@ -894,7 +893,6 @@ class _PostQuoteContent extends StatelessWidget {
|
||||
final bool isFlatted;
|
||||
|
||||
const _PostQuoteContent({
|
||||
super.key,
|
||||
this.isRelativeDate = true,
|
||||
this.isFlatted = false,
|
||||
required this.child,
|
||||
@ -962,7 +960,7 @@ class _PostQuoteContent extends StatelessWidget {
|
||||
class _PostTagsList extends StatelessWidget {
|
||||
final SnPost data;
|
||||
|
||||
const _PostTagsList({super.key, required this.data});
|
||||
const _PostTagsList({required this.data});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -1035,7 +1033,7 @@ class _PostTagsList extends StatelessWidget {
|
||||
class _PostVisibilityHint extends StatelessWidget {
|
||||
final SnPost data;
|
||||
|
||||
const _PostVisibilityHint({super.key, required this.data});
|
||||
const _PostVisibilityHint({required this.data});
|
||||
|
||||
static const List<IconData> kVisibilityIcons = [
|
||||
Symbols.public,
|
||||
@ -1060,7 +1058,7 @@ class _PostVisibilityHint extends StatelessWidget {
|
||||
class _PostTruncatedHint extends StatelessWidget {
|
||||
final SnPost data;
|
||||
|
||||
const _PostTruncatedHint({super.key, required this.data});
|
||||
const _PostTruncatedHint({required this.data});
|
||||
|
||||
static const int kHumanReadSpeed = 238;
|
||||
|
||||
@ -1102,7 +1100,7 @@ class _PostTruncatedHint extends StatelessWidget {
|
||||
class _PostAbuseReportDialog extends StatefulWidget {
|
||||
final SnPost data;
|
||||
|
||||
const _PostAbuseReportDialog({super.key, required this.data});
|
||||
const _PostAbuseReportDialog({required this.data});
|
||||
|
||||
@override
|
||||
State<_PostAbuseReportDialog> createState() => _PostAbuseReportDialogState();
|
||||
|
@ -96,10 +96,7 @@ class PostMediaPendingList extends StatelessWidget {
|
||||
if (!context.mounted) return;
|
||||
|
||||
final attach = context.read<SnAttachmentProvider>();
|
||||
final newAttach = await attach.updateOne(attachments[idx].attachment!.id, thumbnail.alt, metadata: {
|
||||
...attachments[idx].attachment!.metadata,
|
||||
'thumbnail': thumbnail.rid,
|
||||
});
|
||||
final newAttach = await attach.updateOne(attachments[idx].attachment!.id, thumbnail: thumbnail.rid);
|
||||
|
||||
onUpdate!(idx, PostWriteMedia(newAttach));
|
||||
}
|
||||
|
Reference in New Issue
Block a user