import 'package:comunic/models/advanced_group_info.dart'; import 'package:comunic/ui/widgets/group_following_widget.dart'; import 'package:comunic/ui/widgets/group_icon_widget.dart'; import 'package:comunic/ui/widgets/group_membership_widget.dart'; import 'package:flutter/material.dart'; /// Authorized group page screen /// /// This screen is shown when the user is allowed to access to a group's page /// /// @author Pierre Hubert class AuthorizedGroupPageScreen extends StatefulWidget { final AdvancedGroupInfo advancedGroupInfo; final Function() needRefresh; const AuthorizedGroupPageScreen({ Key key, @required this.advancedGroupInfo, @required this.needRefresh, }) : assert(advancedGroupInfo != null), assert(needRefresh != null), super(key: key); @override _AuthorizedGroupPageScreenState createState() => _AuthorizedGroupPageScreenState(); } class _AuthorizedGroupPageScreenState extends State { AdvancedGroupInfo get _group => widget.advancedGroupInfo; @override Widget build(BuildContext context) { return Column( children: [_buildGroupPageHeader()], ); } /// Build group page header _buildGroupPageHeader() { return Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ GroupIcon( group: _group, ), Text( " ${_group.displayName}", style: TextStyle(fontSize: 20), ), Spacer(), Column( children: [ GroupMembershipWidget( group: _group, onUpdated: () => widget.needRefresh(), ), Container(height: 10,), GroupFollowingWidget( group: _group, onUpdated: () => widget.needRefresh(), ), ], ) ], ), ); } }