3933ff980c
Keep the Material settings implementation while preserving public Cupertino parameters for later cleanup. Narrow settings tests to the Material-only behavior.
47 lines
1.7 KiB
Dart
47 lines
1.7 KiB
Dart
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<Widget> children;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final insets = MediaQuery.paddingOf(context);
|
|
return SingleChildScrollView(
|
|
key: const ValueKey<String>('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: <Widget>[
|
|
for (final (index, child) in children.indexed) ...<Widget>[
|
|
if (index > 0) const SizedBox(height: settingsSectionGap),
|
|
child,
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|