Files
cutdex/lib/features/editor/editor_panel_defaults.dart
T

142 lines
5.0 KiB
Dart

import 'package:cutdex_ui/icons.dart';
import 'package:cutdex/l10n/l10n.dart';
import 'package:cutdex_ui/widgets.dart';
import 'package:cutdex_ui/theme.dart';
import 'package:flutter/material.dart';
/// Empty values while a project's content is being bound to its cards.
class EditorEmptyPanel extends StatelessWidget {
const EditorEmptyPanel({super.key});
@override
Widget build(BuildContext context) =>
const WorkspacePanel(child: SizedBox.expand());
}
class EditorTimelineDefaults extends StatelessWidget {
const EditorTimelineDefaults({super.key, this.showTabs = true});
final bool showTabs;
@override
Widget build(BuildContext context) => Column(
children: [
if (showTabs) ...[
ColoredBox(
key: const Key('timeline-tabs-background'),
color: AppTheme.timelineTabsBackground(context),
child: SizedBox(
key: const Key('timeline-tabs-bar'),
height: AppTheme.isDesktop(context)
? AppDesktopMetrics.timelineTabs
: 26,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: AppTheme.isDesktop(context) ? AppSpacing.small : 0,
),
child: Row(
children: [
if (AppTheme.isDesktop(context))
SizedBox.square(
dimension: AppDesktopMetrics.timelineTabControl,
child: IconButton(
key: const Key('timeline-add-button'),
onPressed: null,
style: AppTheme.timelineTabActionStyle,
icon: const Icon(AppIcons.add, size: 16),
),
)
else
const IconButton(
onPressed: null,
icon: Icon(AppIcons.add, size: 16),
),
],
),
),
),
),
const Divider(height: 1),
],
Expanded(
child: WorkspacePanel(
headerHeight: AppTheme.isDesktop(context)
? AppDesktopMetrics.timelineToolbar
: 32,
headerPadding: EdgeInsets.zero,
controls: SizedBox(
key: const Key('timeline-toolbar'),
height: AppTheme.isDesktop(context)
? AppDesktopMetrics.timelineToolbar
: 32,
child: !AppTheme.isDesktop(context)
? SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
for (final icon in [
AppIcons.undo,
AppIcons.redo,
AppIcons.cut,
AppIcons.alignLeft,
AppIcons.alignRight,
AppIcons.delete,
])
IconButton(
onPressed: null,
icon: Icon(icon, size: 16),
),
],
),
)
: Padding(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.medium,
),
child: AppCommandToolbar(
groups: [
[
AppToolbarCommand(
label: context.l10n.undo,
icon: AppIcons.undo,
onPressed: null,
),
AppToolbarCommand(
label: context.l10n.redo,
icon: AppIcons.redo,
onPressed: null,
),
],
[
AppToolbarCommand(
label: context.l10n.splitAtPlayhead,
icon: AppIcons.cut,
onPressed: null,
),
AppToolbarCommand(
label: context.l10n.trimLeftTooltip,
icon: AppIcons.alignLeft,
onPressed: null,
),
AppToolbarCommand(
label: context.l10n.trimRightTooltip,
icon: AppIcons.alignRight,
onPressed: null,
),
AppToolbarCommand(
label: context.l10n.deleteSelectedClips,
icon: AppIcons.delete,
onPressed: null,
),
],
],
),
),
),
child: const SizedBox.expand(key: Key('timeline-default-tracks')),
),
),
],
);
}