Solian/lib/widgets/indent_wrapper.dart

26 lines
860 B
Dart
Raw Normal View History

2024-04-14 07:58:27 +00:00
import 'package:flutter/material.dart';
import 'package:solian/widgets/navigation_drawer.dart';
class IndentWrapper extends StatelessWidget {
final Widget? child;
final Widget? floatingActionButton;
final List<Widget>? appBarActions;
final bool? hideDrawer;
final bool? noSafeArea;
final String title;
const IndentWrapper({super.key, this.child, required this.title, this.floatingActionButton, this.appBarActions, this.hideDrawer, this.noSafeArea});
@override
Widget build(BuildContext context) {
final content = child ?? Container();
return Scaffold(
appBar: AppBar(title: Text(title), actions: appBarActions),
floatingActionButton: floatingActionButton,
drawer: (hideDrawer ?? false) ? null : const SolianNavigationDrawer(),
body: (noSafeArea ?? false) ? content : SafeArea(child: content),
);
}
}