This commit is contained in:
2025-09-26 18:48:14 +07:00
parent 382a0e7909
commit 30ed6b39b5
85 changed files with 20722 additions and 112 deletions

View File

@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
const CustomAppBar({
super.key,
required this.title,
this.actions,
this.leading,
this.backgroundColor,
this.foregroundColor,
this.elevation = 0,
});
final String title;
final List<Widget>? actions;
final Widget? leading;
final Color? backgroundColor;
final Color? foregroundColor;
final double elevation;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return AppBar(
title: Text(
title,
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
leading: leading,
actions: actions,
elevation: elevation,
backgroundColor: backgroundColor ?? colorScheme.surfaceVariant,
foregroundColor: foregroundColor ?? colorScheme.onSurfaceVariant,
centerTitle: true,
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}