import 'package:cloud_car_internal/constants/app_theme.dart'; import 'package:cloud_car_internal/widget/buttons/cloud_back_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class CloudScaffold extends StatelessWidget { final Widget? body; final Widget? appbar; final Color bodyColor; final Widget? bottomNavi; final FloatingActionButton? fab; final bool extendBody; final String? path; final SystemUiOverlayStyle systemStyle; final String? title; final List actions; final Color? appBarBackColor; final PreferredSizeWidget? appBarBottom; final Widget? endDrawer; const CloudScaffold( {super.key, this.body, this.appbar, this.bodyColor = const Color(0xFFF9F9F9), this.bottomNavi, this.fab, this.systemStyle = SystemStyle.initial, this.extendBody = false, this.path, this.title, this.appBarBackColor = Colors.white, this.appBarBottom, this.actions = const [], this.endDrawer}) : assert(title != null || appbar != null); @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light); return AnnotatedRegion( value: systemStyle, child: Scaffold( endDrawer: endDrawer, backgroundColor: bodyColor, extendBodyBehindAppBar: extendBody, extendBody: extendBody, body: body, appBar: PreferredSize( preferredSize: Size.fromHeight(88.w), child: title == null ? appbar! : AppBar( bottom: appBarBottom, backgroundColor: extendBody ? Colors.transparent : appBarBackColor, leading: const CloudBackButton(), title: Text( title!, style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16.sp), ), actions: actions, ), ), bottomNavigationBar: bottomNavi, floatingActionButton: fab, ), ); } }