alterações em telas
This commit is contained in:
@@ -16,6 +16,14 @@ class NewGroupView extends StatelessWidget {
|
||||
|
||||
const NewGroupView(this.controller, {super.key});
|
||||
|
||||
bool get isGroup => controller.createGroupType == CreateGroupType.group;
|
||||
|
||||
bool get isSpace => controller.createGroupType == CreateGroupType.space;
|
||||
|
||||
bool get isCanal => controller.createGroupType == CreateGroupType.canal;
|
||||
|
||||
bool get isMural => controller.createGroupType == CreateGroupType.mural;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -30,9 +38,13 @@ class NewGroupView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
controller.createGroupType == CreateGroupType.space
|
||||
isSpace
|
||||
? L10n.of(context).newSpace
|
||||
: L10n.of(context).createGroup,
|
||||
: isCanal
|
||||
? L10n.of(context).newCanal
|
||||
: isMural
|
||||
? L10n.of(context).newMural
|
||||
: L10n.of(context).createGroup,
|
||||
),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
@@ -41,19 +53,30 @@ class NewGroupView extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SegmentedButton<CreateGroupType>(
|
||||
selected: {controller.createGroupType},
|
||||
onSelectionChanged: controller.setCreateGroupType,
|
||||
segments: [
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.group,
|
||||
label: Text(L10n.of(context).group),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.space,
|
||||
label: Text(L10n.of(context).space),
|
||||
),
|
||||
],
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: SegmentedButton<CreateGroupType>(
|
||||
selected: {controller.createGroupType},
|
||||
onSelectionChanged: controller.setCreateGroupType,
|
||||
segments: [
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.group,
|
||||
label: Text(L10n.of(context).group),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.space,
|
||||
label: Text(L10n.of(context).space),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.canal,
|
||||
label: Text(L10n.of(context).canal),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: CreateGroupType.mural,
|
||||
label: Text(L10n.of(context).mural),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@@ -85,9 +108,13 @@ class NewGroupView extends StatelessWidget {
|
||||
readOnly: controller.loading,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.people_outlined),
|
||||
labelText: controller.createGroupType == CreateGroupType.space
|
||||
labelText: isSpace
|
||||
? L10n.of(context).spaceName
|
||||
: L10n.of(context).groupName,
|
||||
: isCanal
|
||||
? L10n.of(context).canalName
|
||||
: isMural
|
||||
? L10n.of(context).muralName
|
||||
: L10n.of(context).groupName,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -95,11 +122,15 @@ class NewGroupView extends StatelessWidget {
|
||||
SwitchListTile.adaptive(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
secondary: const Icon(Icons.public_outlined),
|
||||
title: Text(
|
||||
controller.createGroupType == CreateGroupType.space
|
||||
? L10n.of(context).spaceIsPublic
|
||||
: L10n.of(context).groupIsPublic,
|
||||
),
|
||||
title: Text(
|
||||
isSpace
|
||||
? L10n.of(context).spaceIsPublic
|
||||
: isCanal
|
||||
? L10n.of(context).canalIsPublic
|
||||
: isMural
|
||||
? L10n.of(context).muralIsPublic
|
||||
: L10n.of(context).groupIsPublic,
|
||||
),
|
||||
value: controller.publicGroup,
|
||||
onChanged: controller.loading ? null : controller.setPublicGroup,
|
||||
),
|
||||
@@ -144,7 +175,7 @@ class NewGroupView extends StatelessWidget {
|
||||
AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
child: controller.createGroupType == CreateGroupType.space
|
||||
child: !isGroup
|
||||
? ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 32,
|
||||
@@ -153,7 +184,29 @@ class NewGroupView extends StatelessWidget {
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Icon(Icons.info_outlined),
|
||||
),
|
||||
subtitle: Text(L10n.of(context).newSpaceDescription),
|
||||
subtitle: Text(
|
||||
isSpace
|
||||
? L10n.of(context).newSpaceDescription
|
||||
: isCanal
|
||||
? L10n.of(context).newCanalDescription
|
||||
: L10n.of(context).newMuralDescription,
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
child: isCanal
|
||||
? ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 32,
|
||||
),
|
||||
leading: Icon(
|
||||
Icons.admin_panel_settings_outlined,
|
||||
color: theme.colorScheme.onSurface,
|
||||
),
|
||||
subtitle: Text(L10n.of(context).canalOnlyAdminCanPost),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
@@ -168,9 +221,15 @@ class NewGroupView extends StatelessWidget {
|
||||
child: controller.loading
|
||||
? const LinearProgressIndicator()
|
||||
: Text(
|
||||
controller.createGroupType == CreateGroupType.space
|
||||
isSpace
|
||||
? L10n.of(context).createNewSpace
|
||||
: L10n.of(context).createGroupAndInviteUsers,
|
||||
: isCanal
|
||||
? L10n.of(context).createCanalAndInviteUsers
|
||||
: isMural
|
||||
? L10n.of(context)
|
||||
.createMuralAndInviteUsers
|
||||
: L10n.of(context)
|
||||
.createGroupAndInviteUsers,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user