mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 01:35:23 +00:00

changed the method of generating assets to be more declrative when it comes to names of the assets. it now include the file path name e.g (asset in the path "assets/images/home-images/home.png" will be generated as this "String assetsImagesHomeImageshome = "path" ". this will be very helpful in the future when we want to orgnize the assets dir.
67 lines
2.2 KiB
Dart
67 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
|
import 'package:syncrow_app/generated/assets.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
|
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,
|
|
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(
|
|
value: SystemUiOverlayStyle(
|
|
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
|
statusBarIconBrightness: Brightness.dark, // For Android (dark icons)
|
|
statusBarBrightness: Brightness.dark, // For iOS (dark icons)
|
|
),
|
|
child: Scaffold(
|
|
backgroundColor: ColorsManager.backgroundColor,
|
|
extendBodyBehindAppBar: true,
|
|
extendBody: true,
|
|
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.symmetric(horizontal: Constants.defaultPadding),
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage(
|
|
Assets.assetsImagesBackground,
|
|
),
|
|
fit: BoxFit.cover,
|
|
opacity: 0.4,
|
|
),
|
|
),
|
|
child: SafeArea(child: child),
|
|
),
|
|
bottomNavigationBar: bottomNavBar,
|
|
),
|
|
);
|
|
}
|
|
}
|