mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
* feat(mobile): add album description functionality - Introduced a new optional `description` field in the `Album` entity. - Updated `AlbumViewerPageState` to manage `editDescriptionText`. - Created `AlbumDescription` and `AlbumViewerEditableDescription` widgets for displaying and editing album descriptions. - Enhanced `CreateAlbumPage` to include a description input field. - Implemented backend support for updating album descriptions in `AlbumApiRepository` and `AlbumService`. - Updated sync logic to handle album descriptions during data synchronization. - Adjusted UI components to accommodate the new description feature. * fix dart analysis error * remove comment that shouldn't be there * Album header styling * fix: disable edit after album creation --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
51 lines
1.4 KiB
Dart
51 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
|
import 'package:immich_mobile/providers/album/current_album.provider.dart';
|
|
import 'package:immich_mobile/widgets/album/album_viewer_editable_title.dart';
|
|
import 'package:immich_mobile/providers/auth.provider.dart';
|
|
|
|
class AlbumTitle extends ConsumerWidget {
|
|
const AlbumTitle({super.key, required this.titleFocusNode});
|
|
|
|
final FocusNode titleFocusNode;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final userId = ref.watch(authProvider).userId;
|
|
final (isOwner, isRemote, albumName) = ref.watch(
|
|
currentAlbumProvider.select((album) {
|
|
if (album == null) {
|
|
return const (false, false, '');
|
|
}
|
|
|
|
return (
|
|
album.ownerId == userId,
|
|
album.isRemote,
|
|
album.name,
|
|
);
|
|
}),
|
|
);
|
|
|
|
if (isOwner && isRemote) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(left: 8, right: 8),
|
|
child: AlbumViewerEditableTitle(
|
|
albumName: albumName,
|
|
titleFocusNode: titleFocusNode,
|
|
),
|
|
);
|
|
}
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.only(left: 16, right: 8),
|
|
child: Text(
|
|
albumName,
|
|
style: context.textTheme.headlineLarge?.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|