57 lines
1.7 KiB
Dart
57 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tools/l10n/app_l10n.dart';
|
|
|
|
class FinalActionsView extends StatelessWidget {
|
|
const FinalActionsView({
|
|
super.key,
|
|
required this.reportPreview,
|
|
required this.onRestart,
|
|
required this.onSaveReport,
|
|
});
|
|
|
|
final String reportPreview;
|
|
final VoidCallback onRestart;
|
|
final Future<void> Function() onSaveReport;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
context.tr('Действия', 'Actions'),
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
),
|
|
const SizedBox(height: 12),
|
|
FilledButton.icon(
|
|
onPressed: onRestart,
|
|
icon: const Icon(Icons.restart_alt),
|
|
label: Text(context.tr('Начать процесс заново', 'Start over')),
|
|
),
|
|
const SizedBox(height: 8),
|
|
OutlinedButton.icon(
|
|
onPressed: onSaveReport,
|
|
icon: const Icon(Icons.description),
|
|
label: Text(
|
|
context.tr('Сохранить отчет (.txt)', 'Save report (.txt)'),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
Text(context.tr('Предпросмотр отчета', 'Report preview')),
|
|
const SizedBox(height: 8),
|
|
Expanded(
|
|
child: Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Theme.of(context).dividerColor),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: SingleChildScrollView(child: SelectableText(reportPreview)),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|