|
@@ -11,14 +11,14 @@ class TitleBarWidget extends StatelessWidget {
|
|
// VisualDensity property exists for the widget and try to find the right values.
|
|
// VisualDensity property exists for the widget and try to find the right values.
|
|
// https://api.flutter.dev/flutter/material/VisualDensity-class.html
|
|
// https://api.flutter.dev/flutter/material/VisualDensity-class.html
|
|
final List<Widget>? actionIcons;
|
|
final List<Widget>? actionIcons;
|
|
- final bool isTitleBigWithoutLeading;
|
|
|
|
|
|
+ final bool isTitleH2WithoutLeading;
|
|
const TitleBarWidget({
|
|
const TitleBarWidget({
|
|
this.title,
|
|
this.title,
|
|
this.caption,
|
|
this.caption,
|
|
this.flexibleSpaceTitle,
|
|
this.flexibleSpaceTitle,
|
|
this.flexibleSpaceCaption,
|
|
this.flexibleSpaceCaption,
|
|
this.actionIcons,
|
|
this.actionIcons,
|
|
- this.isTitleBigWithoutLeading = false,
|
|
|
|
|
|
+ this.isTitleH2WithoutLeading = false,
|
|
super.key,
|
|
super.key,
|
|
});
|
|
});
|
|
|
|
|
|
@@ -36,7 +36,7 @@ class TitleBarWidget extends StatelessWidget {
|
|
centerTitle: false,
|
|
centerTitle: false,
|
|
titleSpacing: 0,
|
|
titleSpacing: 0,
|
|
title: Padding(
|
|
title: Padding(
|
|
- padding: EdgeInsets.only(left: isTitleBigWithoutLeading ? 16 : 0),
|
|
|
|
|
|
+ padding: EdgeInsets.only(left: isTitleH2WithoutLeading ? 16 : 0),
|
|
child: Column(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
@@ -45,11 +45,11 @@ class TitleBarWidget extends StatelessWidget {
|
|
? const SizedBox.shrink()
|
|
? const SizedBox.shrink()
|
|
: Text(
|
|
: Text(
|
|
title!,
|
|
title!,
|
|
- style: isTitleBigWithoutLeading
|
|
|
|
|
|
+ style: isTitleH2WithoutLeading
|
|
? textTheme.h2Bold
|
|
? textTheme.h2Bold
|
|
: textTheme.largeBold,
|
|
: textTheme.largeBold,
|
|
),
|
|
),
|
|
- caption == null || isTitleBigWithoutLeading
|
|
|
|
|
|
+ caption == null || isTitleH2WithoutLeading
|
|
? const SizedBox.shrink()
|
|
? const SizedBox.shrink()
|
|
: Text(
|
|
: Text(
|
|
caption!,
|
|
caption!,
|
|
@@ -62,11 +62,11 @@ class TitleBarWidget extends StatelessWidget {
|
|
Padding(
|
|
Padding(
|
|
padding: const EdgeInsets.fromLTRB(4, 4, 12, 4),
|
|
padding: const EdgeInsets.fromLTRB(4, 4, 12, 4),
|
|
child: Row(
|
|
child: Row(
|
|
- children: _getActions(),
|
|
|
|
|
|
+ children: _actionsWithPaddingInBetween(),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
- leading: isTitleBigWithoutLeading
|
|
|
|
|
|
+ leading: isTitleH2WithoutLeading
|
|
? null
|
|
? null
|
|
: Padding(
|
|
: Padding(
|
|
padding: const EdgeInsets.all(4),
|
|
padding: const EdgeInsets.all(4),
|
|
@@ -115,7 +115,7 @@ class TitleBarWidget extends StatelessWidget {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- _getActions() {
|
|
|
|
|
|
+ _actionsWithPaddingInBetween() {
|
|
if (actionIcons == null) {
|
|
if (actionIcons == null) {
|
|
return <Widget>[const SizedBox.shrink()];
|
|
return <Widget>[const SizedBox.shrink()];
|
|
}
|
|
}
|