SimpleCloudNotifier/flutter/lib/components/layout/scaffold.dart

36 lines
828 B
Dart
Raw Permalink Normal View History

2024-05-21 23:20:34 +02:00
import 'package:flutter/material.dart';
import 'package:simplecloudnotifier/components/layout/app_bar.dart';
class SCNScaffold extends StatelessWidget {
2024-05-23 17:41:51 +02:00
const SCNScaffold({
Key? key,
required this.child,
this.title,
this.showThemeSwitch = true,
this.showSearch = true,
2024-06-08 20:01:23 +02:00
this.showShare = false,
this.onShare = null,
2024-05-23 17:41:51 +02:00
}) : super(key: key);
2024-05-21 23:20:34 +02:00
final Widget child;
final String? title;
2024-05-23 17:41:51 +02:00
final bool showThemeSwitch;
final bool showSearch;
2024-06-08 20:01:23 +02:00
final bool showShare;
final void Function()? onShare;
2024-05-21 23:20:34 +02:00
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: SCNAppBar(
title: title,
2024-05-23 17:41:51 +02:00
showThemeSwitch: showThemeSwitch,
showSearch: showSearch,
2024-06-08 20:01:23 +02:00
showShare: showShare,
onShare: onShare ?? () {},
2024-05-21 23:20:34 +02:00
),
body: child,
);
}
}