Skip to content
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

Improves the UX of the "Manage Images" menu #35

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 37 additions & 25 deletions lib/views/image_manager/general_collection_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,47 @@ class _GeneralCollectionManagerScreenState extends State<GeneralCollectionManage
],

if(widget.corelated != null) SwitchListTile(
title: const Text("Make elements correlate with eachother"),
subtitle: const Text("This will make each image relate to the other images that will be added"),
title: const Text("Relate all images together"),
subtitle: const Text("Make each added image related to the others in the batch. Useful if you want to add alternative versions of an image"),
secondary: Icon(Icons.hub_outlined),
value: widget.corelated!,
onChanged: widget.onCorelatedChanged
),
const Divider(),
if(widget.saveCollectionToggle != null) SwitchListTile(
title: const Text("Create a collection and put all images inside it"),
subtitle: const Text("It will create a brand new collection and add all images to it"),
value: widget.saveCollectionToggle!,
onChanged: (value) {
if(widget.onSaveCollectionToggle != null) widget.onSaveCollectionToggle!(value);
widget.onErrorChange!(value ? widget.collection.name?.isEmpty ?? true : false);
}
),
if(widget.saveCollectionToggle ?? true) Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: TextFormField(
decoration: const InputDecoration(
labelText: "Name of collection"
// const Divider(),
if(widget.saveCollectionToggle != null) ExpansionTile(
title: Text("Collections"),
subtitle: Text("Create a collection with all images"),
leading: Icon(Icons.photo_library, color: Theme.of(context).colorScheme.onSurfaceVariant),
initiallyExpanded: true,
shape: RoundedRectangleBorder(side: BorderSide.none),
collapsedShape: RoundedRectangleBorder(side: BorderSide.none),
children: [
SwitchListTile(
title: const Text("Create a collection and put all images inside"),
subtitle: const Text("Creates a brand new collection and add all images to it"),
value: widget.saveCollectionToggle!,
onChanged: (value) {
if(widget.onSaveCollectionToggle != null) widget.onSaveCollectionToggle!(value);
widget.onErrorChange!(value ? widget.collection.name?.isEmpty ?? true : false);
}
),
initialValue: widget.collection.name,
validator: (value) => value != null && value.isNotEmpty ? null : "Value is empty",
onChanged: (value) {
widget.collection.name = value;
if(widget.onErrorChange != null) widget.onErrorChange!(value.isEmpty);
},
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: TextFormField(
decoration: const InputDecoration(
labelText: "Name of collection"
),
enabled: widget.saveCollectionToggle ?? true,
initialValue: widget.collection.name,
validator: (value) => value != null && value.isNotEmpty ? null : "Value is empty",
onChanged: (value) {
widget.collection.name = value;
if(widget.onErrorChange != null) widget.onErrorChange!(value.isEmpty);
},
),
),
],
)
],
);
}
Expand Down
Loading