Lint fixes

This commit is contained in:
shilangyu 2021-04-11 00:20:47 +02:00
parent 486978dfeb
commit bb8e5ee525
7 changed files with 11 additions and 21 deletions

View File

@ -71,7 +71,7 @@ class InstancePage extends HookWidget {
void _share() => share('https://$instanceHost', context: context);
void _openMoreMenu(BuildContext c) {
void _openMoreMenu() {
showBottomModal(
context: context,
builder: (context) => Column(
@ -118,9 +118,7 @@ class InstancePage extends HookWidget {
),
actions: [
IconButton(icon: const Icon(Icons.share), onPressed: _share),
IconButton(
icon: Icon(moreIcon),
onPressed: () => _openMoreMenu(context)),
IconButton(icon: Icon(moreIcon), onPressed: _openMoreMenu),
],
flexibleSpace: FlexibleSpaceBar(
background: Stack(children: [
@ -292,14 +290,12 @@ class _AboutTab extends HookWidget {
.number_of_users_online(site.online))),
Chip(
label: Text(L10n.of(context)!
.number_of_users(site.siteView!.counts.users))),
Chip(
label: Text(
'${site.siteView!.counts.communities} communities')),
Chip(label: Text('${site.siteView!.counts.posts} posts')),
.number_of_users(siteView.counts.users))),
Chip(
label:
Text('${site.siteView!.counts.comments} comments')),
Text('${siteView.counts.communities} communities')),
Chip(label: Text('${siteView.counts.posts} posts')),
Chip(label: Text('${siteView.counts.comments} comments')),
].spaced(8),
),
),

View File

@ -405,7 +405,7 @@ class _ImagePicker extends HookWidget {
url.value =
pathToPictrs(user.instanceHost, pictrsDeleteToken.value!.file);
onChange?.call(url.value!);
onChange?.call(url.value);
}
} on Exception catch (_) {
ScaffoldMessenger.of(context).showSnackBar(

View File

@ -425,8 +425,6 @@ class _MarkAsRead extends HookWidget {
@override
Widget build(BuildContext context) {
final accStore = useAccountsStore();
final comment = commentView.comment;
final instanceHost = commentView.instanceHost;
final loggedInAction = useLoggedInAction(instanceHost);

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:lemmy_api_client/v3.dart';
@ -31,8 +30,7 @@ class CommentSection extends HookWidget {
}) : comments =
CommentTree.sortList(sortType, CommentTree.fromList(rawComments)),
rawComments = rawComments
..sort((b, a) => a.comment.published.compareTo(b.comment.published)),
assert(postCreatorId != null);
..sort((b, a) => a.comment.published.compareTo(b.comment.published));
@override
Widget build(BuildContext context) {

View File

@ -15,7 +15,7 @@ class PostListOptions extends StatelessWidget {
required this.onSortChanged,
required this.sortValue,
this.styleButton = true,
}) : assert(sortValue != null);
});
@override
Widget build(BuildContext context) => Padding(

View File

@ -19,9 +19,7 @@ class RevealAfterScroll extends HookWidget {
required this.after,
this.transition = 15,
this.fade = false,
}) : assert(scrollController != null),
assert(child != null),
assert(after != null);
});
@override
Widget build(BuildContext context) {

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:lemmur/hooks/logged_in_action.dart';
import 'package:lemmy_api_client/v3.dart';
import '../hooks/delayed_loading.dart';
import '../hooks/logged_in_action.dart';
import '../l10n/l10n.dart';
import 'markdown_mode_icon.dart';
import 'markdown_text.dart';