Files
eatvio_app/lib/widgets/app_bar/custom_app_bar.dart
2023-12-18 14:47:54 +03:00

52 lines
1.0 KiB
Dart

import 'package:eatvio_app/core/app_export.dart';
import 'package:flutter/material.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(
elevation: 0,
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,
);
}