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

30 lines
756 B
Dart
Raw Normal View History

2020-12-02 11:16:23 +02:00
import 'package:flutter/material.dart';
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
Widget build(final BuildContext context) => AppBar(
title: Padding(
padding: const EdgeInsets.only(top: 4.0),
child: Text(title),
),
leading: hasBackButton
? IconButton(
icon: const Icon(Icons.arrow_back),
onPressed:
onBackButtonPressed ?? () => Navigator.of(context).pop(),
)
: null,
);
2020-12-02 11:16:23 +02:00
}