getPresentationWidgetsCustomAppbarTemplate function
String
getPresentationWidgetsCustomAppbarTemplate(
- String projectName
)
Implementation
String getPresentationWidgetsCustomAppbarTemplate(String projectName) {
return '''
import 'package:flutter/material.dart';
class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
final String? title;
final bool centerTitle;
final List<Widget>? actions;
final Widget? leading;
final Color? backgroundColor;
final Color? titleColor;
final double elevation;
const AppBarWidget({
super.key,
this.title,
this.centerTitle = true,
this.actions,
this.leading,
this.backgroundColor,
this.titleColor,
this.elevation = 0,
});
@override
Widget build(BuildContext context) {
return AppBar(
scrolledUnderElevation: 0,
title: Text(
title ?? "",
style: TextStyle(
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w600,
),
),
centerTitle: centerTitle,
actions: actions,
leading: leading,
backgroundColor: backgroundColor ?? Colors.white,
elevation: elevation,
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}
''';
}