mirror of
https://github.com/ente-io/ente.git
synced 2025-05-05 04:47:41 +00:00
## Description [Documentation followed for the migration](https://docs.flutter.dev/release/breaking-changes/android-predictive-back) ## Tests - [x] Tested screens in which migration wasn't straight forward (HomeScreen)
50 lines
1.1 KiB
Dart
50 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:photos/ente_theme_data.dart';
|
|
|
|
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 PopScope(
|
|
canPop: false,
|
|
child: AlertDialog(
|
|
title: Text(
|
|
widget.message,
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
content: LinearProgressIndicator(
|
|
value: _progress,
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
Theme.of(context).colorScheme.greenAlternative,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|