9551eceaed
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.
39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Submit and optional decline/cancel controls for a pending question.
|
|
///
|
|
/// The web shows `Confirm completion` when every field is external, otherwise
|
|
/// `Send answer`, and offers only the actions the form records. The labels are
|
|
/// passed in so this file stays layout only. Controls use Material widgets.
|
|
Widget chatQuestionControls({
|
|
required BuildContext context,
|
|
required Object? actions,
|
|
required String submitLabel,
|
|
required bool sending,
|
|
required VoidCallback onSubmit,
|
|
required void Function(String action) onAction,
|
|
}) {
|
|
final canDecline = actions is List && actions.contains('decline');
|
|
final canCancel = actions is List && actions.contains('cancel');
|
|
return Wrap(
|
|
spacing: 8,
|
|
runSpacing: 8,
|
|
children: [
|
|
FilledButton(
|
|
onPressed: sending ? null : onSubmit,
|
|
child: Text(sending ? 'Sending…' : submitLabel),
|
|
),
|
|
if (canDecline)
|
|
TextButton(
|
|
onPressed: sending ? null : () => onAction('decline'),
|
|
child: const Text('Decline'),
|
|
),
|
|
if (canCancel)
|
|
TextButton(
|
|
onPressed: sending ? null : () => onAction('cancel'),
|
|
child: const Text('Cancel question'),
|
|
),
|
|
],
|
|
);
|
|
}
|