Files
cutdex/lib/features/properties/properties_editor_page.dart
T
lingjhf 2e0033ce2d
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
feat(workspace): refresh desktop editing experience and prepare 0.1.2
2026-10-09 01:56:01 +08:00

79 lines
2.4 KiB
Dart

import 'package:cutdex_ui/icons.dart';
import 'package:flutter/material.dart';
import 'properties_content.dart';
class PropertiesEditorPage extends StatelessWidget {
const PropertiesEditorPage({
super.key,
required this.projectId,
required this.timelineId,
});
final String projectId;
final String timelineId;
@override
Widget build(BuildContext context) => PropertiesContent(
key: const Key('properties-editor-page'),
projectId: projectId,
timelineId: timelineId,
categoryHeaderHeight: 48,
categoryControls: (context, categories, selected, onSelected) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: DropdownButton<PropertyCategory>(
key: const Key('property-category-picker'),
icon: const Icon(AppIcons.expandMore),
isExpanded: true,
underline: const SizedBox.shrink(),
value: selected,
items: [
for (final category in categories)
DropdownMenuItem(
value: category,
child: Text(category.label(context)),
),
],
onChanged: (category) {
if (category != null) onSelected(category);
},
),
),
);
}
class PropertiesToolPanel extends StatelessWidget {
const PropertiesToolPanel({
super.key,
required this.projectId,
required this.timelineId,
});
final String projectId;
final String timelineId;
@override
Widget build(BuildContext context) => PropertiesContent(
key: const Key('properties-tool-panel'),
projectId: projectId,
timelineId: timelineId,
categoryHeaderHeight: 48,
categoryControls: (context, categories, selected, onSelected) =>
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
for (final category in categories)
TextButton(
key: ValueKey('property-tab-${category.name}'),
style: TextButton.styleFrom(
minimumSize: const Size(64, 48),
foregroundColor: selected == category
? Theme.of(context).colorScheme.primary
: null,
),
onPressed: () => onSelected(category),
child: Text(category.label(context)),
),
],
),
),
);
}