mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../services/localization_service.dart';
|
|
|
|
class SuspectedLocationProgressDialog extends StatelessWidget {
|
|
final String title;
|
|
final String message;
|
|
final double? progress; // 0.0 to 1.0, null for indeterminate
|
|
final VoidCallback? onCancel;
|
|
|
|
const SuspectedLocationProgressDialog({
|
|
super.key,
|
|
required this.title,
|
|
required this.message,
|
|
this.progress,
|
|
this.onCancel,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
title: Row(
|
|
children: [
|
|
const Icon(Icons.help_outline, color: Colors.orange),
|
|
const SizedBox(width: 8),
|
|
Expanded(child: Text(title)),
|
|
],
|
|
),
|
|
content: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(message),
|
|
const SizedBox(height: 16),
|
|
if (progress != null)
|
|
LinearProgressIndicator(value: progress)
|
|
else
|
|
const LinearProgressIndicator(),
|
|
const SizedBox(height: 8),
|
|
if (progress != null)
|
|
Text(
|
|
'${(progress! * 100).toInt()}%',
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
],
|
|
),
|
|
actions: [
|
|
if (onCancel != null)
|
|
TextButton(
|
|
onPressed: onCancel,
|
|
child: Text(LocalizationService.instance.cancel),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |