selfprivacy.org.app/lib/ui/components/brand_header/brand_header.dart

40 lines
1.1 KiB
Dart
Raw Normal View History

2020-12-02 11:16:23 +02:00
import 'package:flutter/material.dart';
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
2020-12-08 21:26:51 +02:00
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
2020-12-02 11:16:23 +02:00
class BrandHeader extends StatelessWidget {
const BrandHeader({
2022-06-05 22:36:32 +03:00
final super.key,
2022-05-24 21:55:39 +03:00
this.title = '',
2020-12-02 11:16:23 +02:00
this.hasBackButton = false,
this.onBackButtonPressed,
2022-06-05 22:36:32 +03:00
});
2020-12-02 11:16:23 +02:00
final String title;
final bool hasBackButton;
final VoidCallback? onBackButtonPressed;
2020-12-02 11:16:23 +02:00
@override
2022-06-05 22:36:32 +03:00
Widget build(final BuildContext context) => Container(
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 11:16:23 +02:00
],
),
);
2020-12-02 11:16:23 +02:00
}