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.
31 lines
764 B
31 lines
764 B
import 'package:flutter/material.dart';
|
|
|
|
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final String title;
|
|
final Widget? subtitle;
|
|
|
|
const CustomAppBar({
|
|
Key? key,
|
|
required this.title,
|
|
this.subtitle,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Size get preferredSize => Size.fromHeight(subtitle == null ? 56.0 : 72.0);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
title: subtitle == null
|
|
? Text(title)
|
|
: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(title, style: TextStyle(fontSize: 20)),
|
|
subtitle!,
|
|
],
|
|
),
|
|
// autres propriétés si besoin
|
|
);
|
|
}
|
|
}
|
|
|