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( key: const Key('property-category-picker'), 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)), ), ], ), ), ); }