mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-22 23:19:21 +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/populate_album.dart';
|
||||||
import 'package:nc_photos/use_case/update_dynamic_album_cover.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/use_case/update_dynamic_album_time.dart';
|
||||||
|
import 'package:nc_photos/widget/processing_dialog.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
class AlbumImporterArguments {
|
class AlbumImporterArguments {
|
||||||
|
@ -210,19 +211,8 @@ class _AlbumImporterState extends State<AlbumImporter> {
|
||||||
showDialog(
|
showDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => WillPopScope(
|
builder: (context) => ProcessingDialog(
|
||||||
onWillPop: () => Future.value(false),
|
text: AppLocalizations.of(context).albumImporterProgressText),
|
||||||
child: AlertDialog(
|
|
||||||
content: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
CircularProgressIndicator(),
|
|
||||||
const SizedBox(width: 24),
|
|
||||||
Text(AppLocalizations.of(context).albumImporterProgressText),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
await _createAllAlbums(context);
|
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