import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; AppBar myAppBar({ required BuildContext context, String title = '', Widget? titleWidget, }) => AppBar( leadingWidth: 56.w, leading: IconButton( icon: const Icon(Icons.arrow_back), onPressed: () { Navigator.of(context).maybePop(); }, ), title: titleWidget ?? Text( title, textAlign: TextAlign.center, style: TextStyle( color: Colors.white, fontSize: 20.sp, fontFamily: 'PingFang SC', fontWeight: FontWeight.w400, ), ), centerTitle: true, backgroundColor: Colors.transparent, elevation: 0, );