You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.3 KiB
76 lines
2.3 KiB
|
|
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<Widget> 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<SystemUiOverlayStyle>(
|
|
value: systemStyle,
|
|
child: Scaffold(
|
|
endDrawer: endDrawer,
|
|
backgroundColor: bodyColor,
|
|
extendBodyBehindAppBar: extendBody,
|
|
extendBody: extendBody,
|
|
body: body,
|
|
appBar: PreferredSize(
|
|
preferredSize: Size.fromHeight(176.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: 32.sp),
|
|
),
|
|
actions: actions,
|
|
),
|
|
),
|
|
bottomNavigationBar: bottomNavi,
|
|
floatingActionButton: fab,
|
|
),
|
|
);
|
|
}
|
|
}
|