remove unneeded abstraction
This commit is contained in:
parent
e4b0441a36
commit
fe90119826
|
@ -1,6 +1,5 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:lemmur/widgets/sortable_infinite_list.dart';
|
||||
import 'package:lemmy_api_client/lemmy_api_client.dart';
|
||||
|
||||
|
@ -31,20 +30,7 @@ class CommunitiesListPage extends StatelessWidget {
|
|||
backgroundColor: theme.cardColor,
|
||||
iconTheme: theme.iconTheme,
|
||||
),
|
||||
body: InfiniteCommunitiesList(fetcher: fetcher),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Infinite list of posts
|
||||
class InfiniteCommunitiesList extends HookWidget {
|
||||
final Future<List<CommunityView>> Function(
|
||||
int page, int batchSize, SortType sortType) fetcher;
|
||||
|
||||
InfiniteCommunitiesList({@required this.fetcher}) : assert(fetcher != null);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SortableInfiniteList<CommunityView>(
|
||||
body: SortableInfiniteList<CommunityView>(
|
||||
fetcher: fetcher,
|
||||
builder: (community) => Column(
|
||||
children: [
|
||||
|
@ -81,5 +67,7 @@ class InfiniteCommunitiesList extends HookWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue