Files
cutdex/lib/features/properties/properties_editor_page.dart
T
lingjhf abc1868550
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
2026-10-08 18:17:12 +00: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)),
),
],
),
),
);
}