import 'package:flutter/material.dart'; import 'settings_layout.dart'; /// The Settings page's scrolling column of groups. /// /// It scrolls behind the floating top bar: instead of a top [SafeArea] it pads /// its start by the bar's height (the top media padding), and its end by the /// floating tab bar's (the bottom media padding), so at rest nothing is hidden /// and scrolled groups pass behind the glass pills. The column starts at the /// bar's own side inset, so the groups line up under the title pill, and stops /// at [settingsContentMaxWidth] on a wide window. class SettingsPageBody extends StatelessWidget { const SettingsPageBody({super.key, required this.children}); final List children; @override Widget build(BuildContext context) { final insets = MediaQuery.paddingOf(context); return SingleChildScrollView( key: const ValueKey('settings.scroll'), padding: EdgeInsets.fromLTRB( insets.left + settingsPageSidePadding, insets.top + settingsPageTopPadding, insets.right + settingsPageSidePadding, insets.bottom + settingsPageBottomPadding, ), child: Align( alignment: AlignmentDirectional.topStart, child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: settingsContentMaxWidth), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ for (final (index, child) in children.indexed) ...[ if (index > 0) const SizedBox(height: settingsSectionGap), child, ], ], ), ), ), ); } }