-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
✨ Support Multiple Special Items #635
base: main
Are you sure you want to change the base?
Conversation
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.
I like this idea, would be better if we go further to support dynamic grid positions. 😆
3f0a752
to
776ab18
Compare
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
bool get shouldBuildSpecialItem => | ||
specialItemPosition != SpecialItemPosition.none && | ||
specialItemBuilder != null; | ||
bool get shouldBuildSpecialItem => specialItems.isNotEmpty; |
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.
The semantics of this field is broken since it no longer respects the builder.
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.
any suggestion for this?
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.
Maybe we can get rid of 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.
If shouldBuildSpecialItem
is removed, then it will always show loading indicator even there are special item to be displayed. Below is the current code which depends on shouldBuildSpecialItem
.
final bool shouldDisplayAssets =
p.hasAssetsToDisplay || shouldBuildSpecialItem;
return AnimatedSwitcher(
duration: switchingPathDuration,
child: shouldDisplayAssets
? Stack(
children: <Widget>[
RepaintBoundary(
child: Column(
children: <Widget>[
Expanded(child: assetsGridBuilder(context)),
bottomActionBar(context),
],
),
),
pathEntityListBackdrop(context),
pathEntityListWidget(context),
],
)
: loadingIndicator(context),
bool get shouldBuildSpecialItem => | ||
specialItemPosition != SpecialItemPosition.none && | ||
specialItemBuilder != null; | ||
bool get shouldBuildSpecialItem => specialItems.isNotEmpty; |
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.
Maybe we can get rid of it.
✨ What's the context?
Current
AssetPickerConfig
only accept singlespecialItemPosition
andspecialItemBuilder
which is is not suitable for cases where multiple special items is required.🛠 Changes being made
specialItems
inAssetPickerConfig
and which accept list ofspecialItemPosition
andspecialItemBuilder
.isPermissionLimited
param toSpecialItemBuilder
typedef for case where special item is required to remove whenisPermissionLimited
is false. Example as below.SpecialPosition.none
enum.✨ Result