mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: DCM - const border radius, constructor & switch expressions (#19515)
* enable border radius, switch exp, const constructor * regenerate provider * more formatting --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
05064f87f0
commit
5b0575b956
130 changed files with 338 additions and 264 deletions
|
|
@ -25,7 +25,7 @@ class DeepLinkService {
|
|||
final CurrentAsset _currentAsset;
|
||||
final CurrentAlbum _currentAlbum;
|
||||
|
||||
DeepLinkService(
|
||||
const DeepLinkService(
|
||||
this._memoryService,
|
||||
this._assetService,
|
||||
this._albumService,
|
||||
|
|
@ -38,16 +38,12 @@ class DeepLinkService {
|
|||
final intent = link.uri.host;
|
||||
final queryParams = link.uri.queryParameters;
|
||||
|
||||
PageRouteInfo<dynamic>? deepLinkRoute;
|
||||
|
||||
switch (intent) {
|
||||
case "memory":
|
||||
deepLinkRoute = await _buildMemoryDeepLink(queryParams['id'] ?? '');
|
||||
case "asset":
|
||||
deepLinkRoute = await _buildAssetDeepLink(queryParams['id'] ?? '');
|
||||
case "album":
|
||||
deepLinkRoute = await _buildAlbumDeepLink(queryParams['id'] ?? '');
|
||||
}
|
||||
PageRouteInfo<dynamic>? deepLinkRoute = switch (intent) {
|
||||
"memory" => await _buildMemoryDeepLink(queryParams['id'] ?? ''),
|
||||
"asset" => await _buildAssetDeepLink(queryParams['id'] ?? ''),
|
||||
"album" => await _buildAlbumDeepLink(queryParams['id'] ?? ''),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Deep link resolution failed, safely handle it based on the app state
|
||||
if (deepLinkRoute == null) {
|
||||
|
|
@ -98,7 +94,7 @@ class DeepLinkService {
|
|||
]);
|
||||
}
|
||||
|
||||
Future<MemoryRoute?> _buildMemoryDeepLink(String memoryId) async {
|
||||
Future<PageRouteInfo?> _buildMemoryDeepLink(String memoryId) async {
|
||||
final memory = await _memoryService.getMemoryById(memoryId);
|
||||
|
||||
if (memory == null) {
|
||||
|
|
@ -108,7 +104,7 @@ class DeepLinkService {
|
|||
return MemoryRoute(memories: [memory], memoryIndex: 0);
|
||||
}
|
||||
|
||||
Future<GalleryViewerRoute?> _buildAssetDeepLink(String assetId) async {
|
||||
Future<PageRouteInfo?> _buildAssetDeepLink(String assetId) async {
|
||||
final asset = await _assetService.getAssetByRemoteId(assetId);
|
||||
|
||||
if (asset == null) {
|
||||
|
|
@ -126,7 +122,7 @@ class DeepLinkService {
|
|||
);
|
||||
}
|
||||
|
||||
Future<AlbumViewerRoute?> _buildAlbumDeepLink(String albumId) async {
|
||||
Future<PageRouteInfo?> _buildAlbumDeepLink(String albumId) async {
|
||||
final album = await _albumService.getAlbumByRemoteId(albumId);
|
||||
|
||||
if (album == null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue