ente/lib/ui/common/linear_progress_dialog.dart

52 lines
1.1 KiB
Dart
Raw Normal View History

// @dart=2.9
2021-06-28 15:52:21 +00:00
import 'package:flutter/material.dart';
2022-07-12 06:30:02 +00:00
import 'package:photos/ente_theme_data.dart';
2021-06-28 15:52:21 +00:00
class LinearProgressDialog extends StatefulWidget {
final String message;
const LinearProgressDialog(this.message, {Key key}) : super(key: key);
@override
LinearProgressDialogState createState() => LinearProgressDialogState();
}
class LinearProgressDialogState extends State<LinearProgressDialog> {
double _progress;
@override
void initState() {
_progress = 0;
super.initState();
}
void setProgress(double progress) {
setState(() {
_progress = progress;
});
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async => false,
child: AlertDialog(
title: Text(
widget.message,
2022-07-04 06:02:17 +00:00
style: const TextStyle(
2021-06-28 15:52:21 +00:00
fontSize: 16,
),
textAlign: TextAlign.center,
),
content: LinearProgressIndicator(
value: _progress,
2022-07-12 06:30:02 +00:00
valueColor: AlwaysStoppedAnimation<Color>(
Theme.of(context).colorScheme.greenAlternative,
),
2021-06-28 15:52:21 +00:00
),
),
);
}
}