-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
refactor(mobile): Use widgets in Immich asset grid #7140
Conversation
Adds comments
Deploying with Cloudflare Pages
|
…the asset grid (#7142) * Uses gradient image placeholders in memory lane and in the asset grid * Changes to create placeholders in immmich image.thumbnail * removed unused import
final brightness = MediaQuery.platformBrightnessOf(context); | ||
return Container( | ||
width: width, | ||
height: height, | ||
margin: margin, | ||
decoration: BoxDecoration( | ||
gradient: LinearGradient( | ||
colors: brightness == Brightness.light ? _brightColors : _darkColors, | ||
begin: Alignment.topCenter, |
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.
Since we have a theme switcher from within the app, the apps theme need not be in sync with the platforms theme. Kindly use the isDarkTheme getter from the context itself (context.isDarkTheme
), which checks the brightness from the current themedata of the context. Since it is already a boolean, we need not explicitly check for equality when assigning colors to the gradient as well
With the way it is handled now, if the app is in dark theme and the platform theme is light, we'd display light colored placeholders instead of dark ones.
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.
Thank you, I've addressed this in my revision.
final bool selectionActive; | ||
final Function(List<Asset>) selectAssets; | ||
final Function(List<Asset>) deselectAssets; | ||
final Function(List<Asset>) allAssetsSelected; |
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.
NIT: Can we make the return type more explicit for the allAssetsSelected
callback?
final Function(List<Asset>) allAssetsSelected; | |
final bool Function(List<Asset>) allAssetsSelected; |
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've fixed this in my revision.
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! The only thing that needs updating is the theme handling in placeholder
buildThing
with a Widgetmain