Skip to content

Commit c819e2f

Browse files
Merge pull request #1902 from EnsembleUI/header-null-check
header default pinned behaviour and null checks
2 parents 244896a + 3a875eb commit c819e2f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/ensemble/lib/framework/view/page.dart

+7-6
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ class PageState extends State<Page>
404404
curve: curve,
405405
duration: duration,
406406
backgroundWidget: backgroundWidget,
407-
expandedBarHeight: flexibleMaxHeight,
408-
collapsedBarHeight: flexibleMinHeight,
407+
expandedBarHeight: flexibleMaxHeight?? titleBarHeight,
408+
collapsedBarHeight: flexibleMinHeight?? titleBarHeight,
409409
floating: scrollMode == ScrollMode.floating,
410410
pinned: scrollMode == ScrollMode.pinned,
411411

@@ -919,9 +919,10 @@ class _AnimatedAppBarState extends State<AnimatedAppBar> {
919919
}
920920

921921
void _updateCollapseState() {
922-
bool newState = widget.scrollController.hasClients &&
923-
widget.scrollController.offset >
924-
(widget.expandedBarHeight - widget.collapsedBarHeight);
922+
bool newState = widget.scrollController != null &&
923+
widget.scrollController.hasClients &&
924+
widget.scrollController.offset >
925+
(widget.expandedBarHeight - widget.collapsedBarHeight);
925926

926927
if (newState != isCollapsed) {
927928
setState(() {
@@ -980,8 +981,8 @@ class _AnimatedAppBarState extends State<AnimatedAppBar> {
980981
}
981982

982983
enum ScrollMode {
983-
floating,
984984
pinned,
985+
floating,
985986
}
986987
class ActionResponse {
987988
Map<String, dynamic>? _resultData;

0 commit comments

Comments
 (0)