diff --git a/lib/constants/layout.dart b/lib/constants/layout.dart index 3b517652..fe6739a0 100644 --- a/lib/constants/layout.dart +++ b/lib/constants/layout.dart @@ -129,10 +129,6 @@ const edgeInsetsL12T4R12B4 = EdgeInsets.only( /// An [EdgeInsets] with 12 at left and 12 at right. const edgeInsetsL12R12 = EdgeInsets.only(left: 12, right: 12); -/// An [EdgeInsets] with 10 at left, 5 at top, 10 at right and 20 at bottom. -const edgeInsetsL12T4R12B24 = - EdgeInsets.only(left: 12, top: 4, right: 12, bottom: 24); - /// An [EdgeInsets] with 60 at left and 12 at bottom. const edgeInsetsL60B12 = EdgeInsets.only(left: 60, bottom: 12); diff --git a/lib/features/forum/view/forum_page.dart b/lib/features/forum/view/forum_page.dart index 2493b3d7..59e9e8aa 100644 --- a/lib/features/forum/view/forum_page.dart +++ b/lib/features/forum/view/forum_page.dart @@ -225,7 +225,7 @@ class _ForumPageState extends State if (state.rulesElement == null) { content = ListView.separated( controller: _pinnedScrollController, - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12, itemCount: state.stickThreadList.length, itemBuilder: (context, index) => NormalThreadCard(state.stickThreadList[index]), @@ -234,7 +234,7 @@ class _ForumPageState extends State } else { content = ListView.separated( controller: _pinnedScrollController, - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12, itemCount: state.stickThreadList.length + 1, itemBuilder: (context, index) { // TODO: Do NOT add leading rules card by checking index value. @@ -416,7 +416,7 @@ class _ForumPageState extends State }, child: ListView.separated( controller: _subredditScrollController, - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12, itemCount: subredditList.length, itemBuilder: (context, index) => ForumCard(subredditList[index]), separatorBuilder: (context, index) => sizedBoxW4H4, diff --git a/lib/features/homepage/view/homepage_page.dart b/lib/features/homepage/view/homepage_page.dart index c140faa7..87386f54 100644 --- a/lib/features/homepage/view/homepage_page.dart +++ b/lib/features/homepage/view/homepage_page.dart @@ -183,7 +183,7 @@ class _HomepagePageState extends State { childBuilder: (context, physics) => ListView( physics: physics, controller: _scrollController, - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12B4, children: [ WelcomeSection( forumStatus: state.forumStatus, diff --git a/lib/features/latest_thread/view/latest_thread_page.dart b/lib/features/latest_thread/view/latest_thread_page.dart index 22592ae2..828edbb1 100644 --- a/lib/features/latest_thread/view/latest_thread_page.dart +++ b/lib/features/latest_thread/view/latest_thread_page.dart @@ -30,31 +30,29 @@ class _LatestThreadPageState extends State { ..finishRefresh() ..finishLoad(); - return Padding( - padding: edgeInsetsL12T4R12B24, - child: EasyRefresh( - controller: _refreshController, - header: const MaterialHeader(), - footer: const MaterialFooter(), - onRefresh: () async { - context - .read() - .add(LatestThreadRefreshRequested(widget.url)); + return EasyRefresh( + controller: _refreshController, + header: const MaterialHeader(), + footer: const MaterialFooter(), + onRefresh: () async { + context + .read() + .add(LatestThreadRefreshRequested(widget.url)); + }, + onLoad: () async { + if (state.nextPageUrl == null) { + _refreshController.finishLoad(IndicatorResult.noMore); + return; + } + context.read().add(LatestThreadLoadMoreRequested()); + }, + child: ListView.separated( + padding: edgeInsetsL12T4R12, + itemCount: state.threadList.length, + itemBuilder: (context, index) { + return LatestThreadCard(state.threadList[index]); }, - onLoad: () async { - if (state.nextPageUrl == null) { - _refreshController.finishLoad(IndicatorResult.noMore); - return; - } - context.read().add(LatestThreadLoadMoreRequested()); - }, - child: ListView.separated( - itemCount: state.threadList.length, - itemBuilder: (context, index) { - return LatestThreadCard(state.threadList[index]); - }, - separatorBuilder: (context, index) => sizedBoxW4H4, - ), + separatorBuilder: (context, index) => sizedBoxW4H4, ), ); } diff --git a/lib/features/my_thread/view/my_thread_page.dart b/lib/features/my_thread/view/my_thread_page.dart index 82a2f6ab..1d1be03b 100644 --- a/lib/features/my_thread/view/my_thread_page.dart +++ b/lib/features/my_thread/view/my_thread_page.dart @@ -90,6 +90,7 @@ class _MyThreadPageState extends State ); } else { child = ListView.separated( + padding: edgeInsetsL12T4R12, itemCount: state.replyList.length, itemBuilder: (context, index) { return MyThreadCard(state.replyList[index]); @@ -98,26 +99,23 @@ class _MyThreadPageState extends State ); } - return Padding( - padding: edgeInsetsL12T4R12B24, - child: EasyRefresh( - controller: _replyRefreshController, - header: const MaterialHeader(), - footer: const MaterialFooter(), - onRefresh: () async { - context.read().add(MyThreadRefreshReplyRequested()); - }, - onLoad: () async { - if (state.nextReplyPageUrl == null) { - _replyRefreshController.finishLoad(IndicatorResult.noMore); - return; - } - context - .read() - .add(const MyThreadLoadMoreReplyRequested()); - }, - child: child, - ), + return EasyRefresh( + controller: _replyRefreshController, + header: const MaterialHeader(), + footer: const MaterialFooter(), + onRefresh: () async { + context.read().add(MyThreadRefreshReplyRequested()); + }, + onLoad: () async { + if (state.nextReplyPageUrl == null) { + _replyRefreshController.finishLoad(IndicatorResult.noMore); + return; + } + context + .read() + .add(const MyThreadLoadMoreReplyRequested()); + }, + child: child, ); } diff --git a/lib/features/packet/view/packet_detail_page.dart b/lib/features/packet/view/packet_detail_page.dart index 0023a18c..cbe2aa55 100644 --- a/lib/features/packet/view/packet_detail_page.dart +++ b/lib/features/packet/view/packet_detail_page.dart @@ -117,7 +117,7 @@ class _PacketDetailPageState extends State { child: Row( children: [ SizedBox( - width: 20, + width: 30, child: Text( '${dataSorted[index].id}', style: Theme.of(context) diff --git a/lib/features/rate/view/rate_post_page.dart b/lib/features/rate/view/rate_post_page.dart index f0c74957..af13ff7b 100644 --- a/lib/features/rate/view/rate_post_page.dart +++ b/lib/features/rate/view/rate_post_page.dart @@ -214,6 +214,7 @@ class _RatePostPageState extends State with LoggerMixin { children: scoreWidgetList, ), ), + sizedBoxW8H8, Row( children: [ sizedBoxW12H12, diff --git a/lib/features/search/view/search_page.dart b/lib/features/search/view/search_page.dart index 773a89ed..b5bfd0f7 100644 --- a/lib/features/search/view/search_page.dart +++ b/lib/features/search/view/search_page.dart @@ -410,7 +410,7 @@ class _SearchPageState extends State with LoggerMixin { Widget _buildBody(BuildContext context, SearchState state) { return Padding( - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12, child: Column( children: [ if (expandForm) _buildSearchForm(context, state), diff --git a/lib/features/topics/view/topics_page.dart b/lib/features/topics/view/topics_page.dart index 7c2b4a2b..351c4325 100644 --- a/lib/features/topics/view/topics_page.dart +++ b/lib/features/topics/view/topics_page.dart @@ -62,7 +62,7 @@ class _TopicsPageState extends State final groupTabBodyList = forumGroupList .map( (e) => ListView.separated( - padding: edgeInsetsL12T4R12B24, + padding: edgeInsetsL12T4R12, itemCount: e.forumList.length, itemBuilder: (context, index) => ForumCard(e.forumList[index]), separatorBuilder: (context, index) => sizedBoxW4H4,