Skip to content

Commit

Permalink
Fix exception on AppBar without title
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke committed Jan 25, 2025
1 parent 4da9647 commit 9d5a213
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/app_bar/title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class AnimatedTitle extends MultiChildRenderObjectWidget {
final double t;

static Widget _createChild(EndState state) {
final title = state.appBar.title;
if (title == null) return const SizedBox();

var style = state.titleTextStyle;
if (style?.color != null) {
style = style!.copyWith(
Expand All @@ -31,7 +28,10 @@ class AnimatedTitle extends MultiChildRenderObjectWidget {

return _AnimatedTitleParentDataWidget(
hasLeading: state.leading != null,
child: DefaultTextStyle.merge(style: style, child: title),
child: DefaultTextStyle.merge(
style: style,
child: state.appBar.title ?? const SizedBox.shrink(),
),
);
}

Expand Down

0 comments on commit 9d5a213

Please sign in to comment.