Files
retail/lib/shared/widgets/custom_app_bar.dart
Phuoc Nguyen b94c158004 runable
2025-10-10 16:38:07 +07:00

33 lines
692 B
Dart

import 'package:flutter/material.dart';
/// Custom app bar widget
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget>? actions;
final Widget? leading;
final PreferredSizeWidget? bottom;
const CustomAppBar({
super.key,
required this.title,
this.actions,
this.leading,
this.bottom,
});
@override
Widget build(BuildContext context) {
return AppBar(
title: Text(title),
leading: leading,
actions: actions,
bottom: bottom,
);
}
@override
Size get preferredSize => Size.fromHeight(
kToolbarHeight + (bottom?.preferredSize.height ?? 0.0),
);
}