neonAppBar function

AppBar neonAppBar({
  1. required dynamic context,
  2. required String heading,
  3. IconData icon = Icons.arrow_back,
  4. Color iconColor = Colors.black87,
  5. void onTap()?,
  6. Color backgroundColor = Colors.transparent,
  7. Color appBarShadowColor = Colors.transparent,
  8. double elevation = 0,
  9. Color headingColor = Colors.white,
  10. FontWeight headingFontWeight = FontWeight.bold,
})

Implementation

AppBar neonAppBar({
  required context,
  required String heading,
  IconData icon = Icons.arrow_back,
  Color iconColor = Colors.black87,
  void Function()? onTap,
  Color backgroundColor = Colors.transparent,
  Color appBarShadowColor = Colors.transparent,
  double elevation = 0,
  Color headingColor = Colors.white,
  FontWeight headingFontWeight = FontWeight.bold,
}) {
  return AppBar(
    leading: IconButton(
      icon: Icon(
        icon,
        color: iconColor,
      ),
      onPressed: onTap ?? () => Navigator.of(context).pop(),
    ),
    elevation: elevation,
    shadowColor: appBarShadowColor,
    title: Text(
      heading,
      style: TextStyle(
        color: headingColor,
        fontSize: 20,
        fontWeight: headingFontWeight,
      ),
    ),
    centerTitle: true,
    backgroundColor: backgroundColor,
  );
}