Merge branch 'develop' into v4

This commit is contained in:
Salvatore Giordano
2022-04-29 16:24:12 +02:00
80 changed files with 607 additions and 180 deletions
@@ -68,9 +68,11 @@ class StreamChannelHeader extends StatelessWidget
this.showConnectionStateTile = false,
this.title,
this.subtitle,
this.centerTitle,
this.leading,
this.actions,
this.backgroundColor,
this.elevation = 1,
}) : preferredSize = const Size.fromHeight(kToolbarHeight),
super(key: key);
@@ -99,6 +101,9 @@ class StreamChannelHeader extends StatelessWidget
/// Subtitle widget
final Widget? subtitle;
/// Whether the title should be centered
final bool? centerTitle;
/// Leading widget
final Widget? leading;
@@ -109,8 +114,16 @@ class StreamChannelHeader extends StatelessWidget
/// The background color for this [StreamChannelHeader].
final Color? backgroundColor;
/// The elevation for this [StreamChannelHeader].
final double elevation;
@override
Widget build(BuildContext context) {
final effectiveCenterTitle = getEffectiveCenterTitle(
Theme.of(context),
actions: actions,
centerTitle: centerTitle,
);
final channel = StreamChannel.of(context).channel;
final channelHeaderTheme = StreamChannelHeaderTheme.of(context);
@@ -151,7 +164,7 @@ class StreamChannelHeader extends StatelessWidget
systemOverlayStyle: theme.brightness == Brightness.dark
? SystemUiOverlayStyle.light
: SystemUiOverlayStyle.dark,
elevation: 1,
elevation: elevation,
leading: leadingWidget,
backgroundColor: backgroundColor ?? channelHeaderTheme.color,
actions: actions ??
@@ -170,14 +183,16 @@ class StreamChannelHeader extends StatelessWidget
),
),
],
centerTitle: true,
centerTitle: centerTitle,
title: InkWell(
onTap: onTitleTap,
child: SizedBox(
height: preferredSize.height,
width: preferredSize.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: effectiveCenterTitle
? CrossAxisAlignment.center
: CrossAxisAlignment.stretch,
children: <Widget>[
title ??
StreamChannelName(