-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added animated Header #1871
added animated Header #1871
Conversation
scrollableView: true, | ||
showNavigationIcon: pageModel.runtimeStyles?['showNavigationIcon'], | ||
); | ||
// if (appBar is SliverAppBar) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are commenting out this condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was already a check in _buildAppBar function
but it's importance came up later so will be adding it back
@@ -387,8 +435,11 @@ class PageState extends State<Page> | |||
flexibleSpace: wrapsInFlexible(backgroundWidget), | |||
expandedHeight: flexibleMaxHeight, | |||
collapsedHeight: flexibleMinHeight, | |||
floating: floating ?? false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these values will never be null, as while setting you are already providing fallback value to it as bool? floating = Utils.getBool(evaluatedHeader?['floating'], fallback: false);
, same goes for other values.
void performLayout() { | ||
final double scrollOffset = constraints.scrollOffset; | ||
final double maxExtent = height; | ||
bool repaint = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this value is never used, why we are declaring it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing it as well.
added the requested changes @TheNoumanDev |
@Umair-Manzoor-47 can we hide/unhide the title widget as well? see the attached video in this ticket: #1863 initial state is no header, and when user scrolls down, the header with floating widget appears. |
Sure @sharjeelyunus here is without titleWidget or title
2025-02-19.22-33-57.mp4 |
why do we have a `subtitleWidget` what's the point? How can you have
subtitle without title? this is very confusing
…On Wed, Feb 19, 2025 at 9:37 AM Umair Manzoor ***@***.***> wrote:
Sure @sharjeelyunus <https://github.com/sharjeelyunus> here is without
titleWidget or title
Schema is
header:
subtitleWidget:
Row:
styles:
height: 100
padding: 0
gap: 3
crossAxis: center
mainAxis: center
backgroundColor: blue
children:
- Button:
label: Menu
- Button:
label: Shop
- Button:
label: Cart
- Button:
label: Order
styles:
backgroundColor: White
shadowColor: white
titleBarHeight: 50
animation: true
subtitleHeightOffSet: 100
https://github.com/user-attachments/assets/b09b2e2a-3151-499f-a5e8-0ae20f160f3a
—
Reply to this email directly, view it on GitHub
<#1871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMZUAXKCWKY5CFDYUWKWAT2QS6OFAVCNFSM6AAAAABXER4IIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGMZDKMJWGU>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
[image: Umair-Manzoor-47]*Umair-Manzoor-47* left a comment
(EnsembleUI/ensemble#1871)
<#1871 (comment)>
Sure @sharjeelyunus <https://github.com/sharjeelyunus> here is without
titleWidget or title
Schema is
header:
subtitleWidget:
Row:
styles:
height: 100
padding: 0
gap: 3
crossAxis: center
mainAxis: center
backgroundColor: blue
children:
- Button:
label: Menu
- Button:
label: Shop
- Button:
label: Cart
- Button:
label: Order
styles:
backgroundColor: White
shadowColor: white
titleBarHeight: 50
animation: true
subtitleHeightOffSet: 100
https://github.com/user-attachments/assets/b09b2e2a-3151-499f-a5e8-0ae20f160f3a
—
Reply to this email directly, view it on GitHub
<#1871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMZUAXKCWKY5CFDYUWKWAT2QS6OFAVCNFSM6AAAAABXER4IIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGMZDKMJWGU>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
there's already title and titleWidget |
I'll leave it to Sharjeel and you to decide. I am ok with what Sharjeel
decides
…On Thu, Feb 20, 2025 at 2:04 AM Umair Manzoor ***@***.***> wrote:
there's already title and titleWidget
There are two options.
*1.* Either I can include a different widget that drops down as user
scrolls. Independent of title or TitleWidget
*2.* Make the whole Header Dropdown
@kmahmood74 <https://github.com/kmahmood74> @TheNoumanDev
<https://github.com/TheNoumanDev>
—
Reply to this email directly, view it on GitHub
<#1871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMZUAVPP4EBVGPO6CZ25I32QWSBTAVCNFSM6AAAAABXER4IIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZRGAZDCNRRGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: Umair-Manzoor-47]*Umair-Manzoor-47* left a comment
(EnsembleUI/ensemble#1871)
<#1871 (comment)>
there's already title and titleWidget
There are two options.
*1.* Either I can include a different widget that drops down as user
scrolls. Independent of title or TitleWidget
*2.* Make the whole Header Dropdown
@kmahmood74 <https://github.com/kmahmood74> @TheNoumanDev
<https://github.com/TheNoumanDev>
—
Reply to this email directly, view it on GitHub
<#1871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMZUAVPP4EBVGPO6CZ25I32QWSBTAVCNFSM6AAAAABXER4IIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZRGAZDCNRRGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
bool? pinned = Utils.getBool(evaluatedHeader?['pinned'], fallback: false); | ||
bool? snapped = Utils.getBool(evaluatedHeader?['snapped'], fallback: false); | ||
bool? floating = | ||
Utils.getBool(evaluatedHeader?['floating'], fallback: false); | ||
appBarBehaviour behaviour = | ||
Utils.getEnum<appBarBehaviour>(evaluatedHeader?['scrollMode'], appBarBehaviour.values); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have pinned
, snapped
, and floating
properties here? aren't using scrollMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, before merging the PR, please also create Docs and Schema PR.
ticket: #1863
header.webm