Files
syncrow-web/lib/web_layout/web_scaffold.dart
2024-08-27 01:55:11 +03:00

59 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import 'package:syncrow_web/web_layout/web_app_bar.dart';
import 'menu_sidebar.dart';
class WebScaffold extends StatelessWidget with HelperResponsiveLayout {
final bool enableMenuSideba;
final Widget? appBarTitle;
final List<Widget>? appBarBody;
final Widget? scaffoldBody;
const WebScaffold(
{super.key,
this.appBarTitle,
this.appBarBody,
this.scaffoldBody,
this.enableMenuSideba = true});
@override
Widget build(BuildContext context) {
final isSmall = isSmallScreenSize(context);
return Scaffold(
body: Stack(
children: [
SizedBox(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
child: SvgPicture.asset(
Assets.webBackground,
fit: BoxFit.cover,
),
),
Container(
color: Colors.white.withOpacity(0.7),
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Opacity(
opacity: 0.7,
child: WebAppBar(
title: appBarTitle,
body: appBarBody,
)),
Expanded(
child: Row(
children: [
if (enableMenuSideba && !isSmall) const MenuSidebar(),
Expanded(flex: 5, child: scaffoldBody!)
],
),
)
],
),
],
));
}
}