70 lines
1.8 KiB
Dart
70 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../core/theme/design_tokens.dart';
|
|
import '../../../../shared/widgets/back_title_page_header.dart';
|
|
|
|
class SettingsPageScaffold extends StatelessWidget {
|
|
const SettingsPageScaffold({
|
|
super.key,
|
|
required this.title,
|
|
required this.body,
|
|
this.footer,
|
|
this.onBack,
|
|
this.trailing,
|
|
this.resizeOnKeyboard = true,
|
|
this.maintainBottomViewPadding = false,
|
|
});
|
|
|
|
final String title;
|
|
final Widget body;
|
|
final Widget? footer;
|
|
final VoidCallback? onBack;
|
|
final Widget? trailing;
|
|
final bool resizeOnKeyboard;
|
|
final bool maintainBottomViewPadding;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
return Scaffold(
|
|
backgroundColor: colorScheme.surfaceContainerLow,
|
|
resizeToAvoidBottomInset: resizeOnKeyboard,
|
|
body: SafeArea(
|
|
maintainBottomViewPadding: maintainBottomViewPadding,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
BackTitlePageHeader(
|
|
title: title,
|
|
onBack: onBack,
|
|
trailing: trailing,
|
|
),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
padding: const EdgeInsets.fromLTRB(
|
|
AppSpacing.xl,
|
|
AppSpacing.sm,
|
|
AppSpacing.xl,
|
|
AppSpacing.xl,
|
|
),
|
|
child: body,
|
|
),
|
|
),
|
|
if (footer != null)
|
|
Padding(
|
|
padding: const EdgeInsets.fromLTRB(
|
|
AppSpacing.xl,
|
|
AppSpacing.none,
|
|
AppSpacing.xl,
|
|
AppSpacing.xl,
|
|
),
|
|
child: footer,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|