Files
eatvio_app/lib/widgets/app_bar/custom_app_bar.dart
2024-06-04 12:35:12 +03:00

56 lines
1.2 KiB
Dart

import 'package:eatvio_app/core/app_export.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// ignore: must_be_immutable
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
CustomAppBar({
Key? key,
this.height,
this.leadingWidth,
this.leading,
this.title,
this.centerTitle,
this.actions,
}) : super(
key: key,
);
final double? height;
final double? leadingWidth;
final Widget? leading;
final Widget? title;
final bool? centerTitle;
final List<Widget>? actions;
@override
Widget build(BuildContext context) {
return AppBar(
systemOverlayStyle: SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
),
toolbarHeight: height ?? 56.v,
automaticallyImplyLeading: false,
backgroundColor: Colors.transparent,
leadingWidth: leadingWidth ?? 0,
leading: leading,
title: title,
titleSpacing: 0,
centerTitle: centerTitle ?? false,
actions: actions,
);
}
@override
Size get preferredSize => Size(
mediaQueryData.size.width,
height ?? 56.v,
);
}