mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
fixed save button position
This commit is contained in:
@ -70,12 +70,16 @@ class CommunityStructureHeader extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (communityName != null)
|
if (communityName != null)
|
||||||
Row(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (!isEditingName)
|
if (!isEditingName)
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
communityName!,
|
communityName!,
|
||||||
style: theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
|
style:
|
||||||
|
theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),
|
),
|
||||||
@ -89,11 +93,12 @@ class CommunityStructureHeader extends StatelessWidget {
|
|||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
),
|
),
|
||||||
style: theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
|
style:
|
||||||
|
theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
|
||||||
onSubmitted: onNameSubmitted,
|
onSubmitted: onNameSubmitted,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 2),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onEditName,
|
onTap: onEditName,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
@ -102,8 +107,13 @@ class CommunityStructureHeader extends StatelessWidget {
|
|||||||
height: 16,
|
height: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(flex: 3), // Pushes the Save button to the right
|
],
|
||||||
if (isSave) _buildActionButtons(theme),
|
),
|
||||||
|
),
|
||||||
|
if (isSave) ...[
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
_buildActionButtons(theme),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -119,18 +129,16 @@ class CommunityStructureHeader extends StatelessWidget {
|
|||||||
label: "Save",
|
label: "Save",
|
||||||
icon: const Icon(Icons.save, size: 18, color: ColorsManager.spaceColor),
|
icon: const Icon(Icons.save, size: 18, color: ColorsManager.spaceColor),
|
||||||
onPressed: onSave,
|
onPressed: onSave,
|
||||||
theme: theme
|
theme: theme),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildButton({
|
Widget _buildButton(
|
||||||
required String label,
|
{required String label,
|
||||||
required Widget icon,
|
required Widget icon,
|
||||||
required VoidCallback onPressed,
|
required VoidCallback onPressed,
|
||||||
required ThemeData theme
|
required ThemeData theme}) {
|
||||||
}) {
|
|
||||||
const double buttonHeight = 30;
|
const double buttonHeight = 30;
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxWidth: 80, minHeight: buttonHeight),
|
constraints: BoxConstraints(maxWidth: 80, minHeight: buttonHeight),
|
||||||
|
Reference in New Issue
Block a user