import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class PageAppbar extends StatelessWidget implements PreferredSizeWidget { final Color? backgroundColor; final Color? color; final String title; const PageAppbar({super.key, required this.title, this.backgroundColor, this.color}); @override Widget build(BuildContext context) { return AppBar( backgroundColor: backgroundColor ?? const Color.fromRGBO(255, 255, 255, 1), surfaceTintColor: backgroundColor ?? const Color.fromRGBO(255, 255, 255, 1), centerTitle: true, foregroundColor: color, title: Text( title, style: TextStyle( fontSize: ScreenUtil().setWidth(32), fontWeight: FontWeight.bold, color: color ), ), ); } @override Size get preferredSize => const Size.fromHeight(kToolbarHeight); }