Skip to content

Commit 993939b

Browse files
committed
refactor: improve code readability of padding argument in buildBody()
1 parent 4a936e6 commit 993939b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/components/common_body.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ Widget buildBody(
8383
case Success():
8484
var dataList = (commonController.loadingState.value as Success).response
8585
as List<Datum>;
86+
87+
var bottomPadding = MediaQuery.of(Get.context!).padding.bottom;
8688
return ListView.separated(
8789
controller: commonController.scrollController,
8890
physics: AlwaysScrollableScrollPhysics(
8991
parent: isReply2Reply
9092
? const ClampingScrollPhysics()
9193
: const BouncingScrollPhysics(),
9294
),
93-
padding: EdgeInsets.only(
94-
left: isReply2Reply ? 0 : 10,
95-
top: isReply2Reply ? 0 : 10,
96-
right: isReply2Reply ? 0 : 10,
97-
bottom: (isReply2Reply ? 0 : 10) +
98-
MediaQuery.of(Get.context!).padding.bottom),
95+
padding: isReply2Reply
96+
? EdgeInsets.only(bottom: bottomPadding)
97+
: EdgeInsets.only(
98+
left: 10, top: 10, right: 10, bottom: 10 + bottomPadding),
9999
itemCount: dataList.length + 1,
100100
itemBuilder: (_, index) {
101101
if (index == dataList.length) {

0 commit comments

Comments
 (0)