forked from eatvio/eatvio_app
40 lines
927 B
Dart
40 lines
927 B
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(
|
|
toolbarHeight: height ?? 56,
|
|
automaticallyImplyLeading: false,
|
|
backgroundColor: Colors.transparent,
|
|
leadingWidth: leadingWidth ?? 0,
|
|
leading: leading,
|
|
title: title,
|
|
titleSpacing: 0,
|
|
centerTitle: centerTitle ?? false,
|
|
actions: actions,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => Size(double.infinity, height ?? 56);
|
|
}
|