mirror of
https://github.com/immich-app/immich.git
synced 2024-11-18 11:29:11 -07:00
4309104925
* New features - Share album. Users can now create albums to share with existing people on the network. - Owner can delete the album. - Owner can invite the additional users to the album. - Shared users and the owner can add additional assets to the album. * In the asset viewer, the user can swipe up to see detailed information and swip down to dismiss. * Several UI enhancements.
69 lines
2.3 KiB
Dart
69 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/modules/sharing/providers/album_title.provider.dart';
|
|
|
|
class AlbumTitleTextField extends ConsumerWidget {
|
|
const AlbumTitleTextField({
|
|
Key? key,
|
|
required this.isAlbumTitleEmpty,
|
|
required this.albumTitleTextFieldFocusNode,
|
|
required this.albumTitleController,
|
|
required this.isAlbumTitleTextFieldFocus,
|
|
}) : super(key: key);
|
|
|
|
final ValueNotifier<bool> isAlbumTitleEmpty;
|
|
final FocusNode albumTitleTextFieldFocusNode;
|
|
final TextEditingController albumTitleController;
|
|
final ValueNotifier<bool> isAlbumTitleTextFieldFocus;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
return TextField(
|
|
onChanged: (v) {
|
|
if (v.isEmpty) {
|
|
isAlbumTitleEmpty.value = true;
|
|
} else {
|
|
isAlbumTitleEmpty.value = false;
|
|
}
|
|
|
|
ref.watch(albumTitleProvider.notifier).setAlbumTitle(v);
|
|
},
|
|
focusNode: albumTitleTextFieldFocusNode,
|
|
style: TextStyle(fontSize: 28, color: Colors.grey[700], fontWeight: FontWeight.bold),
|
|
controller: albumTitleController,
|
|
onTap: () {
|
|
isAlbumTitleTextFieldFocus.value = true;
|
|
|
|
if (albumTitleController.text == 'Untitled') {
|
|
albumTitleController.clear();
|
|
}
|
|
},
|
|
decoration: InputDecoration(
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
|
suffixIcon: !isAlbumTitleEmpty.value && isAlbumTitleTextFieldFocus.value
|
|
? IconButton(
|
|
onPressed: () {
|
|
albumTitleController.clear();
|
|
isAlbumTitleEmpty.value = true;
|
|
},
|
|
icon: const Icon(Icons.cancel_rounded),
|
|
splashRadius: 10,
|
|
)
|
|
: null,
|
|
enabledBorder: OutlineInputBorder(
|
|
borderSide: const BorderSide(color: Colors.transparent),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: const BorderSide(color: Colors.transparent),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
hintText: 'Add a title',
|
|
focusColor: Colors.grey[300],
|
|
fillColor: Colors.grey[200],
|
|
filled: isAlbumTitleTextFieldFocus.value,
|
|
),
|
|
);
|
|
}
|
|
}
|