appBar function

AppBar appBar(
  1. BuildContext context, {
  2. List<Widget>? actions,
  3. Widget? leadingWidget,
  4. Widget? titleWidget,
})

Implementation

AppBar appBar(BuildContext context, {List<Widget>? actions, Widget? leadingWidget, Widget? titleWidget}){
  return AppBar(
    elevation: 0,
    centerTitle: true,
    backgroundColor: Pallet.white,
    title: titleWidget,
    toolbarHeight: ScreenUtil().setHeight(50),
    leading: leadingWidget ?? IconButton(
      color: Pallet.black,
      iconSize: setWidth(24),
      onPressed: () => Navigator.of(context).pop(),
      icon: Icon(Icons.arrow_back, size: setWidth(24), color: Pallet.black,)
    ),
    actions: actions,
  );
}