import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:gascom/constants/app_theme.dart'; class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { const CustomAppBar({super.key, this.title}); final String? title; @override Size get preferredSize => const Size.fromHeight(80); @override Widget build(BuildContext context) { return AppBar( toolbarHeight: 80, titleSpacing: 0, backgroundColor: AppTheme.primaryColor, surfaceTintColor: AppTheme.primaryColor, title: Text( title ?? "", style: Theme.of(context).textTheme.titleLarge, ), leading: IconButton( icon: const Icon(CupertinoIcons.back, color: AppTheme.textColor,), onPressed: () { Navigator.pop(context); }, ), bottom: title == null ? null : PreferredSize( preferredSize: const Size.fromHeight(1), child: Container( color: AppTheme.yellowColor, height: 1, margin: const EdgeInsets.symmetric(horizontal: 20), ), ), ); } }