2020-12-02 09:16:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
2020-12-08 19:26:51 +00:00
|
|
|
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
2020-12-02 09:16:23 +00:00
|
|
|
|
|
|
|
class BrandHeader extends StatelessWidget {
|
|
|
|
const BrandHeader({
|
2022-06-05 19:36:32 +00:00
|
|
|
final 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-06-05 19:36:32 +00:00
|
|
|
Widget build(final BuildContext context) => Container(
|
2022-06-05 22:40:34 +00:00
|
|
|
height: 52,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: hasBackButton ? 1 : 15,
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
if (hasBackButton) ...[
|
|
|
|
IconButton(
|
|
|
|
icon: const Icon(BrandIcons.arrowLeft),
|
|
|
|
onPressed:
|
|
|
|
onBackButtonPressed ?? () => Navigator.of(context).pop(),
|
|
|
|
),
|
|
|
|
const SizedBox(width: 10),
|
|
|
|
],
|
|
|
|
BrandText.h4(title),
|
|
|
|
const Spacer(),
|
2020-12-02 09:16:23 +00:00
|
|
|
],
|
2022-06-05 22:40:34 +00:00
|
|
|
),
|
|
|
|
);
|
2020-12-02 09:16:23 +00:00
|
|
|
}
|