Move editor UI into the app and release verified Core dependencies (#14)
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
@@ -0,0 +1,132 @@
|
||||
import 'package:cutdex/l10n/l10n.dart';
|
||||
import 'package:cutdex_core/editor.dart';
|
||||
import 'package:cutdex_ui/icons.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'property_keyframe_controls.dart';
|
||||
import 'effect_labels.dart';
|
||||
import 'property_layer_row.dart';
|
||||
|
||||
class EffectList extends StatelessWidget {
|
||||
const EffectList({
|
||||
super.key,
|
||||
required this.stack,
|
||||
required this.enabled,
|
||||
required this.keyframes,
|
||||
required this.onAdd,
|
||||
required this.onReorder,
|
||||
required this.onToggle,
|
||||
required this.onRemove,
|
||||
required this.editorBuilder,
|
||||
this.error,
|
||||
});
|
||||
final ClipEffectStack stack;
|
||||
final bool enabled;
|
||||
final PropertyKeyframeControls keyframes;
|
||||
final void Function(ClipEffectType) onAdd;
|
||||
final void Function(List<String>) onReorder;
|
||||
final void Function(ClipEffectLayer) onToggle, onRemove;
|
||||
final Widget Function(ClipEffectLayer) editorBuilder;
|
||||
final String? error;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final layers = stack.layers;
|
||||
return AppPropertySection(
|
||||
bottomSpacing: layers.isEmpty ? 0 : null,
|
||||
child: AppPropertyGroup(
|
||||
label: context.l10n.effects,
|
||||
padChild: false,
|
||||
actions: [
|
||||
keyframes.button(
|
||||
context,
|
||||
stack.parameterIds,
|
||||
context.l10n.effects,
|
||||
'effects-key',
|
||||
),
|
||||
AppDropdownMenu(
|
||||
enabled: enabled,
|
||||
builder: (context, toggle, focus) => IconButton(
|
||||
key: const ValueKey('effect-add'),
|
||||
focusNode: focus,
|
||||
tooltip: context.l10n.addEffect,
|
||||
onPressed: enabled ? toggle : null,
|
||||
icon: const Icon(AppIcons.add, size: 16),
|
||||
),
|
||||
items: [
|
||||
for (final type in ClipEffectType.values)
|
||||
AppMenuItem(
|
||||
label: type.label(context),
|
||||
onPressed: enabled && stack.canAdd(type)
|
||||
? () => onAdd(type)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ReorderableListView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
padding: EdgeInsets.zero,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
buildDefaultDragHandles: false,
|
||||
onReorderItem: (from, to) {
|
||||
if (!enabled) return;
|
||||
final order = layers.map((l) => l.id).toList();
|
||||
order.insert(to, order.removeAt(from));
|
||||
onReorder(order);
|
||||
},
|
||||
children: [
|
||||
for (var i = 0; i < layers.length; i++)
|
||||
PropertyLayerRow(
|
||||
key: ValueKey('effect-layer-${layers[i].id}'),
|
||||
id: layers[i].id,
|
||||
prefix: 'effect',
|
||||
index: i,
|
||||
enabled: enabled,
|
||||
visible: layers[i].enabled,
|
||||
label: layers[i].type.label(context),
|
||||
tooltip: context.l10n.effects,
|
||||
onVisibility: () => onToggle(layers[i]),
|
||||
onRemove: () => onRemove(layers[i]),
|
||||
menuItems: [
|
||||
for (final (delta, label) in [
|
||||
(-1, context.l10n.effectMoveUp),
|
||||
(1, context.l10n.effectMoveDown),
|
||||
])
|
||||
AppMenuItem(
|
||||
label: label,
|
||||
closeAncestors: false,
|
||||
onPressed:
|
||||
!enabled ||
|
||||
i + delta < 0 ||
|
||||
i + delta >= layers.length
|
||||
? null
|
||||
: () {
|
||||
final order = layers
|
||||
.map((l) => l.id)
|
||||
.toList();
|
||||
order.insert(i + delta, order.removeAt(i));
|
||||
onReorder(order);
|
||||
},
|
||||
),
|
||||
],
|
||||
editor: editorBuilder(layers[i]),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (error != null)
|
||||
Text(
|
||||
error!,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user