diff --git a/lib/common/widgets/dynamic_sliver_appbar_medium.dart b/lib/common/widgets/dynamic_sliver_appbar_medium.dart index 010e9513..606666b7 100644 --- a/lib/common/widgets/dynamic_sliver_appbar_medium.dart +++ b/lib/common/widgets/dynamic_sliver_appbar_medium.dart @@ -119,15 +119,17 @@ class _DynamicSliverAppBarMediumState extends State { }); } - @override - void didChangeDependencies() { - _height = 0; - _updateHeight(); - super.didChangeDependencies(); - } + Orientation? _orientation; @override Widget build(BuildContext context) { + final orientation = MediaQuery.of(context).orientation; + if (orientation != _orientation) { + _orientation = orientation; + _height = 0; + _updateHeight(); + } + //Needed to lay out the flexibleSpace the first time, so we can calculate its intrinsic height if (_height == 0) { return SliverToBoxAdapter(