Files
FlClash/lib/features/form/form_page.dart
T
chen08209 9bd2286eb5 feat(ui): layer surfaces with fills and follow the iOS type scale
Changelog: iOS-style surfaces, alerts and sheets; clearer TV focus
2026-10-17 17:21:43 +08:00

54 lines
1.4 KiB
Dart

import 'package:fl_clash/common/common.dart';
import 'package:fl_clash/ui/icons/icons.dart';
import 'package:fl_clash/ui/ui.dart';
import 'package:material_ui/material_ui.dart';
import 'custom_issue.dart';
/// A form [showFormSheet] opens: grouped rows under a bar whose check saves,
/// with why the last save was refused above them.
class FormPage extends StatelessWidget {
final String title;
final VoidCallback onSave;
final String? saveLabel;
final List<IconButtonData> actions;
final String? error;
final bool saving;
final List<Widget> children;
const FormPage({
super.key,
required this.title,
required this.onSave,
this.saveLabel,
this.actions = const [],
this.error,
this.saving = false,
required this.children,
});
@override
Widget build(BuildContext context) {
return CommonScaffold(
title: title,
iconActions: actions,
confirmationAction: IconButtonData(
glyph: AppGlyphs.check,
tooltip: saveLabel ?? context.appLocalizations.save,
isLoading: saving,
onPressed: saving ? null : onSave,
),
body: ListView(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
horizontal: 16,
).copyWith(top: context.contentTopPadding, bottom: 20),
children: [
ErrorBanner(message: error),
...children,
],
),
);
}
}