55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/api_gateway.dart';
|
|
import '../../../ui/adaptive/host.dart';
|
|
import '../actions/decision_action.dart';
|
|
import '../actions/decision_wording.dart';
|
|
import '../domain/run_decisions.dart';
|
|
|
|
/// A recorded human checkpoint, never an audit-export/resource wait.
|
|
class RunDecisionNotice extends StatelessWidget {
|
|
const RunDecisionNotice({
|
|
super.key,
|
|
required this.run,
|
|
required this.gateway,
|
|
required this.onRunChanged,
|
|
});
|
|
final JsonMap run;
|
|
final ApiGateway gateway;
|
|
final ValueChanged<JsonMap> onRunChanged;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final pending = pendingDecision(run);
|
|
if (pending == null) return const SizedBox.shrink();
|
|
final content = Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Semantics(header: true, child: const Text(decisionWaitingTitle)),
|
|
Text(decisionMeta(pending)),
|
|
HumanDecisionAction(
|
|
run: run,
|
|
gateway: gateway,
|
|
onRunChanged: onRunChanged,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
if (usesCupertinoHost(context)) {
|
|
return CupertinoListSection.insetGrouped(
|
|
children: [
|
|
DefaultTextStyle(
|
|
style: CupertinoTheme.of(context).textTheme.textStyle,
|
|
child: content,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
return Card(child: content);
|
|
}
|
|
}
|