42 lines
992 B
Dart
42 lines
992 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
class TitleAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final String title;
|
|
final Widget? leading;
|
|
final List<Widget> actions;
|
|
final Color shadowColor;
|
|
|
|
TitleAppBar({
|
|
super.key,
|
|
required this.title,
|
|
this.leading,
|
|
this.actions = const [],
|
|
this.shadowColor = Colors.black,
|
|
});
|
|
|
|
final height = 45.sp; // musr be greater than logo height
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
toolbarHeight: height,
|
|
leading: leading,
|
|
title: Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: 20.sp,
|
|
letterSpacing: 1.5,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
actions: actions,
|
|
surfaceTintColor: Colors.transparent,
|
|
shadowColor: shadowColor,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => Size.fromHeight(height); // + _dividerHeight);
|
|
}
|