mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Extract processing dialog widget
This commit is contained in:
parent
decf78f9b7
commit
77461ded3a
2 changed files with 31 additions and 13 deletions
|
@ -20,6 +20,7 @@ import 'package:nc_photos/use_case/create_album.dart';
|
|||
import 'package:nc_photos/use_case/populate_album.dart';
|
||||
import 'package:nc_photos/use_case/update_dynamic_album_cover.dart';
|
||||
import 'package:nc_photos/use_case/update_dynamic_album_time.dart';
|
||||
import 'package:nc_photos/widget/processing_dialog.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class AlbumImporterArguments {
|
||||
|
@ -210,19 +211,8 @@ class _AlbumImporterState extends State<AlbumImporter> {
|
|||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (context) => WillPopScope(
|
||||
onWillPop: () => Future.value(false),
|
||||
child: AlertDialog(
|
||||
content: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
const SizedBox(width: 24),
|
||||
Text(AppLocalizations.of(context).albumImporterProgressText),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
builder: (context) => ProcessingDialog(
|
||||
text: AppLocalizations.of(context).albumImporterProgressText),
|
||||
);
|
||||
try {
|
||||
await _createAllAlbums(context);
|
||||
|
|
28
lib/widget/processing_dialog.dart
Normal file
28
lib/widget/processing_dialog.dart
Normal file
|
@ -0,0 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class ProcessingDialog extends StatelessWidget {
|
||||
ProcessingDialog({
|
||||
Key key,
|
||||
@required this.text,
|
||||
});
|
||||
|
||||
@override
|
||||
build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () => Future.value(false),
|
||||
child: AlertDialog(
|
||||
content: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
const SizedBox(width: 24),
|
||||
Text(text),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final String text;
|
||||
}
|
Loading…
Reference in a new issue