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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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