remove unneeded abstraction

This commit is contained in:
krawieck 2020-09-29 11:13:17 +02:00
parent e4b0441a36
commit fe90119826
1 changed files with 4 additions and 16 deletions

View File

@ -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 {
),
],
),
);
),
);
}
}