redesign for settings page

This commit is contained in:
Arseni
2026-03-13 23:01:57 +03:00
parent 70bd7a6214
commit d601f245d4
36 changed files with 1151 additions and 262 deletions

View File

@@ -0,0 +1,58 @@
import 'package:flutter/material.dart';
import 'package:pweb/pages/settings/profile/actions/constants.dart';
class ProfileActionButtonsLayout extends StatelessWidget {
const ProfileActionButtonsLayout({super.key, required this.children});
final List<Widget> children;
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final isCompact =
constraints.maxWidth <
ProfileActionsLayoutConstants.compactBreakpoint;
if (isCompact) {
return Center(
child: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: ProfileActionsLayoutConstants.buttonWidth,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: _buildChildren(isCompact: true),
),
),
);
}
return Row(
mainAxisSize: MainAxisSize.min,
children: _buildChildren(isCompact: false),
);
},
);
}
List<Widget> _buildChildren({required bool isCompact}) {
return [
for (var index = 0; index < children.length; index++) ...[
SizedBox(
width: isCompact
? double.infinity
: ProfileActionsLayoutConstants.buttonWidth,
child: children[index],
),
if (index != children.length - 1)
SizedBox(
width: isCompact ? 0 : ProfileActionsLayoutConstants.buttonGap,
height: isCompact ? ProfileActionsLayoutConstants.buttonGap : 0,
),
],
];
}
}