2020-12-02 09:16:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class BrandHeader extends StatelessWidget {
|
|
|
|
const BrandHeader({
|
2022-10-26 16:26:09 +00:00
|
|
|
super.key,
|
2022-05-24 18:55:39 +00:00
|
|
|
this.title = '',
|
2020-12-02 09:16:23 +00:00
|
|
|
this.hasBackButton = false,
|
2022-05-19 14:26:57 +00:00
|
|
|
this.onBackButtonPressed,
|
2022-06-05 19:36:32 +00:00
|
|
|
});
|
2020-12-02 09:16:23 +00:00
|
|
|
|
|
|
|
final String title;
|
|
|
|
final bool hasBackButton;
|
2022-05-19 14:26:57 +00:00
|
|
|
final VoidCallback? onBackButtonPressed;
|
2020-12-02 09:16:23 +00:00
|
|
|
|
|
|
|
@override
|
2022-10-04 10:34:56 +00:00
|
|
|
Widget build(final BuildContext context) => AppBar(
|
|
|
|
title: Padding(
|
|
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
|
|
child: Text(title),
|
2022-06-05 22:40:34 +00:00
|
|
|
),
|
2022-10-04 10:34:56 +00:00
|
|
|
leading: hasBackButton
|
|
|
|
? IconButton(
|
|
|
|
icon: const Icon(Icons.arrow_back),
|
2022-06-05 22:40:34 +00:00
|
|
|
onPressed:
|
|
|
|
onBackButtonPressed ?? () => Navigator.of(context).pop(),
|
2022-10-04 10:34:56 +00:00
|
|
|
)
|
|
|
|
: null,
|
2023-02-24 16:45:32 +00:00
|
|
|
actions: const [
|
|
|
|
SizedBox.shrink(),
|
|
|
|
],
|
2022-06-05 22:40:34 +00:00
|
|
|
);
|
2020-12-02 09:16:23 +00:00
|
|
|
}
|