2024-04-14 07:58:27 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-04-30 12:31:54 +00:00
|
|
|
import 'package:solian/router.dart';
|
2024-04-16 12:36:47 +00:00
|
|
|
import 'package:solian/widgets/common_wrapper.dart';
|
2024-04-14 07:58:27 +00:00
|
|
|
import 'package:solian/widgets/navigation_drawer.dart';
|
|
|
|
|
2024-04-16 12:36:47 +00:00
|
|
|
class IndentWrapper extends LayoutWrapper {
|
2024-04-30 12:31:54 +00:00
|
|
|
final bool hideDrawer;
|
2024-05-01 16:49:38 +00:00
|
|
|
final bool fixedAppBarColor;
|
2024-04-14 07:58:27 +00:00
|
|
|
|
2024-04-16 12:36:47 +00:00
|
|
|
const IndentWrapper({
|
|
|
|
super.key,
|
|
|
|
super.child,
|
|
|
|
required super.title,
|
|
|
|
super.floatingActionButton,
|
|
|
|
super.appBarActions,
|
2024-04-30 12:31:54 +00:00
|
|
|
this.hideDrawer = false,
|
2024-05-01 16:49:38 +00:00
|
|
|
this.fixedAppBarColor = false,
|
2024-04-30 12:31:54 +00:00
|
|
|
super.noSafeArea = false,
|
2024-04-16 12:36:47 +00:00
|
|
|
}) : super();
|
2024-04-14 07:58:27 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final content = child ?? Container();
|
|
|
|
|
|
|
|
return Scaffold(
|
2024-04-30 12:31:54 +00:00
|
|
|
appBar: AppBar(
|
2024-05-01 09:37:34 +00:00
|
|
|
leading: hideDrawer
|
|
|
|
? IconButton(
|
|
|
|
icon: const Icon(Icons.arrow_back),
|
|
|
|
onPressed: () => router.pop(),
|
|
|
|
)
|
|
|
|
: null,
|
2024-04-30 12:31:54 +00:00
|
|
|
title: Text(title),
|
|
|
|
actions: appBarActions,
|
2024-05-01 16:49:38 +00:00
|
|
|
centerTitle: false,
|
|
|
|
elevation: fixedAppBarColor ? 4 : null,
|
2024-04-30 12:31:54 +00:00
|
|
|
),
|
2024-04-14 07:58:27 +00:00
|
|
|
floatingActionButton: floatingActionButton,
|
2024-04-30 12:31:54 +00:00
|
|
|
drawer: const SolianNavigationDrawer(),
|
|
|
|
body: noSafeArea ? content : SafeArea(child: content),
|
2024-04-14 07:58:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|