import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; class AppBarUtil extends StatelessWidget implements PreferredSizeWidget { final String title; final VoidCallback? onBackButtonPressed; final Widget? actionButton; const AppBarUtil({ Key? key, required this.title, this.onBackButtonPressed, this.actionButton, }) : super(key: key); @override Widget build(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, forceMaterialTransparency: true, elevation: 0.0, leading: FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, borderWidth: 1.0, buttonSize: 60.0, icon: Icon( Icons.keyboard_arrow_left, color: FlutterFlowTheme.of(context).primaryText, size: 30.0, ), onPressed: onBackButtonPressed ?? () => Navigator.of(context).pop(), ), title: Text( title, style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, fontSize: 15.0, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), ), ), actions: [ if (actionButton != null) actionButton!, ], centerTitle: true, ); } @override Size get preferredSize => const Size.fromHeight(kToolbarHeight); }