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

45 lines
1.2 KiB
Dart
Raw Normal View History

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';
2021-05-25 21:53:54 +00:00
import 'package:selfprivacy/ui/components/pre_styled_buttons/pre_styled_buttons.dart';
2020-12-02 09:16:23 +00:00
class BrandHeader extends StatelessWidget {
const BrandHeader({
2021-03-15 15:39:44 +00:00
Key? key,
this.title = "",
2020-12-02 09:16:23 +00:00
this.hasBackButton = false,
2021-05-25 21:53:54 +00:00
this.hasFlashButton = false,
2020-12-02 09:16:23 +00:00
}) : super(key: key);
final String title;
final bool hasBackButton;
2021-05-25 21:53:54 +00:00
final bool hasFlashButton;
2020-12-02 09:16:23 +00:00
@override
Widget build(BuildContext context) {
return Container(
2020-12-03 16:52:53 +00:00
height: 52,
alignment: Alignment.centerLeft,
2020-12-02 09:16:23 +00:00
padding: EdgeInsets.only(
left: hasBackButton ? 1 : 15,
),
child: Container(
child: Row(
children: [
if (hasBackButton) ...[
IconButton(
icon: Icon(BrandIcons.arrow_left),
onPressed: () => Navigator.of(context).pop(),
),
SizedBox(width: 10),
],
2020-12-08 19:26:51 +00:00
BrandText.h4(title),
2021-05-25 21:53:54 +00:00
Spacer(),
if (hasFlashButton) PreStyledButtons.flash(),
2020-12-02 09:16:23 +00:00
],
),
),
);
}
}