You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
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;
|
|
final Widget? right;
|
|
const PageAppbar({super.key, required this.title, this.backgroundColor, this.color, this.right});
|
|
|
|
@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,
|
|
actions: right != null ? [right ?? Container()] : null,
|
|
title: Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: ScreenUtil().setWidth(13),
|
|
fontWeight: FontWeight.w500,
|
|
color: const Color.fromRGBO(51, 51, 51, 1)
|
|
),
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
|
}
|