Files
pipelines/app/lib/features/templates/ui/template_create_controls.dart
alan 9551eceaed Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
2026-11-11 21:55:39 +00:00

50 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'template_create_wording.dart';
/// Full wrapping native label, not a clipped placeholder/floating field label.
class TemplateCreateNameField extends StatelessWidget {
const TemplateCreateNameField({
super.key,
required this.controller,
required this.enabled,
required this.onSubmit,
});
final TextEditingController controller;
final bool enabled;
final VoidCallback onSubmit;
@override
Widget build(BuildContext context) => MergeSemantics(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(templateCreateNameLabel),
const SizedBox(height: 8),
TextField(
key: templateCreateNameKey,
controller: controller,
enabled: enabled,
autofocus: true,
textInputAction: TextInputAction.done,
onSubmitted: (_) => onSubmit(),
),
],
),
);
}
Widget templateCreateDialogAction({
required Key key,
required VoidCallback? onPressed,
required Widget child,
bool primary = false,
}) {
if (primary) {
return FilledButton(key: key, onPressed: onPressed, child: child);
}
return TextButton(key: key, onPressed: onPressed, child: child);
}