diff --git a/lib/pages/instance.dart b/lib/pages/instance.dart index 9c206fc..a82fed5 100644 --- a/lib/pages/instance.dart +++ b/lib/pages/instance.dart @@ -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), ), ), diff --git a/lib/pages/manage_account.dart b/lib/pages/manage_account.dart index 30c2afc..eda538a 100644 --- a/lib/pages/manage_account.dart +++ b/lib/pages/manage_account.dart @@ -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( diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index b402b31..be67a39 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -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); diff --git a/lib/widgets/comment_section.dart b/lib/widgets/comment_section.dart index 9fd4ebe..be87a25 100644 --- a/lib/widgets/comment_section.dart +++ b/lib/widgets/comment_section.dart @@ -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) { diff --git a/lib/widgets/post_list_options.dart b/lib/widgets/post_list_options.dart index c2aa9d4..a2bc022 100644 --- a/lib/widgets/post_list_options.dart +++ b/lib/widgets/post_list_options.dart @@ -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( diff --git a/lib/widgets/reveal_after_scroll.dart b/lib/widgets/reveal_after_scroll.dart index 6b97fd8..6d2c371 100644 --- a/lib/widgets/reveal_after_scroll.dart +++ b/lib/widgets/reveal_after_scroll.dart @@ -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) { diff --git a/lib/widgets/write_comment.dart b/lib/widgets/write_comment.dart index b5e349a..51d2e86 100644 --- a/lib/widgets/write_comment.dart +++ b/lib/widgets/write_comment.dart @@ -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';