diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index 56b7603..fa76395 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -13,18 +13,19 @@ import '../util/text_color.dart'; import 'bottom_modal.dart'; import 'markdown_text.dart'; -const colors = [ - Colors.pink, - Colors.green, - Colors.amber, - Colors.cyan, - Colors.indigo, -]; - class Comment extends StatelessWidget { final int indent; final int postCreatorId; final CommentTree commentTree; + + static const colors = [ + Colors.pink, + Colors.green, + Colors.amber, + Colors.cyan, + Colors.indigo, + ]; + Comment( this.commentTree, { this.indent = 0, diff --git a/lib/widgets/comment_section.dart b/lib/widgets/comment_section.dart index 4df3466..95b19ba 100644 --- a/lib/widgets/comment_section.dart +++ b/lib/widgets/comment_section.dart @@ -7,14 +7,6 @@ import '../comment_tree.dart'; import 'bottom_modal.dart'; import 'comment.dart'; -const sortPairs = { - CommentSortType.hot: [Icons.whatshot, 'Hot'], - CommentSortType.new_: [Icons.new_releases, 'New'], - CommentSortType.old: [Icons.calendar_today, 'Old'], - CommentSortType.top: [Icons.trending_up, 'Top'], - CommentSortType.chat: [Icons.chat, 'Chat'], -}; - /// Manages comments section, sorts them class CommentSection extends HookWidget { final List rawComments; @@ -22,6 +14,14 @@ class CommentSection extends HookWidget { final int postCreatorId; final CommentSortType sortType; + static const sortPairs = { + CommentSortType.hot: [Icons.whatshot, 'Hot'], + CommentSortType.new_: [Icons.new_releases, 'New'], + CommentSortType.old: [Icons.calendar_today, 'Old'], + CommentSortType.top: [Icons.trending_up, 'Top'], + CommentSortType.chat: [Icons.chat, 'Chat'], + }; + CommentSection( List rawComments, { @required this.postCreatorId,