From 9d5a21341a95cbc4c46b8227fa301b6e37f859b8 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Sat, 25 Jan 2025 22:25:03 +0100 Subject: [PATCH] Fix exception on AppBar without title --- lib/src/app_bar/title.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/app_bar/title.dart b/lib/src/app_bar/title.dart index 3f75d82..f9cfd30 100644 --- a/lib/src/app_bar/title.dart +++ b/lib/src/app_bar/title.dart @@ -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( @@ -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(), + ), ); }