Skip to content

Commit 2b60fe1

Browse files
fix other errors and clean some code
1 parent d5483be commit 2b60fe1

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

lib/presentation/community/screens/pending_requests_screen.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ class PendingRequestsScreen extends HookConsumerWidget {
3434
UIUtils.createHeader(
3535
AppLocalizations.of(context)!.pending_requests_title),
3636
const SizedBox(height: 40),
37-
Expanded(
38-
child: pendingRequestsStateProvider.when(
37+
pendingRequestsStateProvider.when(
3938
data: (initialData) {
4039
return PendingRequestsListWidget(
4140
users: initialData.list,
@@ -51,7 +50,7 @@ class PendingRequestsScreen extends HookConsumerWidget {
5150
error: (error, stackTrace) {
5251
return Text('$error');
5352
},
54-
))
53+
)
5554
])),
5655
floatingActionButtonLocation:
5756
FloatingActionButtonLocation.centerFloat,

lib/presentation/community/widgets/pending_request_list.dart

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,17 @@ class PendingRequestsListWidget extends HookConsumerWidget {
1414
final Function(String) onReject;
1515
final Future<EntityPage<User>> Function({int pageNumber}) bottomListScrollFct;
1616

17-
final ScrollController _scrollController = ScrollController();
18-
19-
PendingRequestsListWidget(
17+
const PendingRequestsListWidget(
2018
{super.key,
2119
required this.users,
2220
required this.total,
2321
required this.onAccept,
2422
required this.onReject,
2523
required this.bottomListScrollFct});
2624

27-
void onScroll() {
28-
if (_scrollController.position.pixels ==
29-
_scrollController.position.maxScrollExtent) {}
30-
}
31-
3225
@override
3326
Widget build(BuildContext context, WidgetRef ref) {
34-
_scrollController.addListener(onScroll);
35-
/*return ListView.builder(
36-
controller: _scrollController,
37-
itemCount: users.length,
38-
itemBuilder: (context, index) {
39-
final user = users[index];
40-
return ListTile(
41-
title: Text(
42-
UserUtils.getNameOrUsername(user),
43-
),
44-
trailing: AcceptRefuseWidget(
45-
userId: user.id,
46-
onAccept: onAccept,
47-
onReject: onReject,
48-
),
49-
);
50-
},
51-
);*/
52-
return Expanded(
53-
child: InfiniteScrollList(
27+
return InfiniteScrollList(
5428
listId: 'PENDING_REQUESTS',
5529
initialData: users,
5630
total: total,
@@ -72,6 +46,6 @@ class PendingRequestsListWidget extends HookConsumerWidget {
7246
),
7347
);
7448
},
75-
));
49+
);
7650
}
7751
}

lib/presentation/my_activities/screens/activity_details_screen.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ class ActivityDetailsScreen extends HookConsumerWidget {
107107
body: TabBarView(
108108
controller: tabController,
109109
children: [
110-
Expanded(
111-
child: DetailsTab(activity: activity)),
112-
Expanded(
113-
child: GraphTab(activity: activity))
110+
DetailsTab(activity: activity),
111+
GraphTab(activity: activity)
114112
]))))
115113
],
116114
),

0 commit comments

Comments
 (0)