Move constructors above methods

This commit is contained in:
krawieck 2020-09-07 21:42:04 +02:00
parent 5509e0bc90
commit e7380b4914
1 changed files with 11 additions and 11 deletions

View File

@ -14,6 +14,17 @@ class CommunityPage extends HookWidget {
final CommunityView _community;
final String instanceUrl;
CommunityPage({@required String communityName, @required this.instanceUrl})
: assert(communityName != null, instanceUrl != null),
_fullCommunityFuture =
LemmyApi(instanceUrl).v1.getCommunity(name: communityName),
_community = null;
CommunityPage.fromCommunityView(this._community)
: instanceUrl = _community.actorId.split('/')[2],
_fullCommunityFuture = LemmyApi(_community.actorId.split('/')[2])
.v1
.getCommunity(name: _community.name);
void _goToInstance() {
print('GO TO INSTANCE');
}
@ -42,17 +53,6 @@ class CommunityPage extends HookWidget {
print('GO RO CATEGORIES');
}
CommunityPage({@required String communityName, @required this.instanceUrl})
: assert(communityName != null, instanceUrl != null),
_fullCommunityFuture =
LemmyApi(instanceUrl).v1.getCommunity(name: communityName),
_community = null;
CommunityPage.fromCommunityView(this._community)
: instanceUrl = _community.actorId.split('/')[2],
_fullCommunityFuture = LemmyApi(_community.actorId.split('/')[2])
.v1
.getCommunity(name: _community.name);
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);