switched the safe area to be in the scaffold

This commit is contained in:
Mohammad Salameh
2024-04-29 11:38:35 +03:00
parent a12f006d63
commit 3607b5353d
6 changed files with 86 additions and 120 deletions

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
@ -9,11 +8,18 @@ import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
class DefaultScaffold extends StatelessWidget {
const DefaultScaffold(
{super.key, required this.child, this.title, this.actions});
{super.key,
required this.child,
this.title,
this.actions,
this.appBar,
this.bottomNavBar});
final Widget child;
final String? title;
final List<Widget>? actions;
final PreferredSizeWidget? appBar;
final Widget? bottomNavBar;
@override
Widget build(BuildContext context) {
return AnnotatedRegion(
@ -26,20 +32,22 @@ class DefaultScaffold extends StatelessWidget {
backgroundColor: ColorsManager.backgroundColor,
extendBodyBehindAppBar: true,
extendBody: true,
appBar: AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
title: BodyLarge(
text: title ?? "",
fontColor: ColorsManager.primaryColor,
fontWeight: FontsManager.bold,
),
actions: actions,
),
appBar: appBar ??
AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
title: BodyLarge(
text: title ?? "",
fontColor: ColorsManager.primaryColor,
fontWeight: FontsManager.bold,
),
actions: actions,
),
body: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
padding: const EdgeInsets.all(Constants.defaultPadding),
padding:
const EdgeInsets.symmetric(horizontal: Constants.defaultPadding),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
@ -51,6 +59,7 @@ class DefaultScaffold extends StatelessWidget {
),
child: SafeArea(child: child),
),
bottomNavigationBar: bottomNavBar,
),
);
}