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

45 lines
1.2 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';
2021-05-26 00:53:54 +03:00
import 'package:selfprivacy/ui/components/pre_styled_buttons/pre_styled_buttons.dart';
2020-12-02 11:16:23 +02:00
class BrandHeader extends StatelessWidget {
const BrandHeader({
2021-03-15 17:39:44 +02:00
Key? key,
required this.title,
2020-12-02 11:16:23 +02:00
this.hasBackButton = false,
2021-05-26 00:53:54 +03:00
this.hasFlashButton = false,
2020-12-02 11:16:23 +02:00
}) : super(key: key);
final String title;
final bool hasBackButton;
2021-05-26 00:53:54 +03:00
final bool hasFlashButton;
2020-12-02 11:16:23 +02:00
@override
Widget build(BuildContext context) {
return Container(
2020-12-03 18:52:53 +02:00
height: 52,
alignment: Alignment.centerLeft,
2020-12-02 11:16:23 +02: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 21:26:51 +02:00
BrandText.h4(title),
2021-05-26 00:53:54 +03:00
Spacer(),
if (hasFlashButton) PreStyledButtons.flash(),
2020-12-02 11:16:23 +02:00
],
),
),
);
}
}