@@ -82,8 +82,8 @@ class _ImageViewPageState extends State<ImageViewPage> with SingleTickerProvider
8282 MaterialPageRoute (builder: (_) => EditImagesPage (
8383 catId: int .parse (widget.category),
8484 images: [_images[_page]],
85- ))
86- );
85+ )),
86+ ). then ((value) => setState (() {})) ;
8787 }
8888 void _onDownloadImage () async {
8989 if (await confirmDownloadDialog (context,
@@ -100,68 +100,69 @@ class _ImageViewPageState extends State<ImageViewPage> with SingleTickerProvider
100100 ),
101101 ));
102102 await downloadSingleImage (_images[_page]);
103+ setState (() {});
103104 }
104105 }
105106 void _onMoveCopyImage () async {
106107 int choice = await chooseMoveCopyImage (context);
107108
108109 switch (choice) {
109110 case 0 : showDialog (context: context,
110- builder: (context) {
111- return MoveOrCopyDialog (
112- title: appStrings (context).moveImage_title,
113- subtitle: appStrings (context).moveImage_selectAlbum (1 , _images[_page]['name' ]),
114- catId: widget.category,
115- catName: widget.title,
116- isImage: true ,
117- onSelected: (item) async {
118- if (await confirmMoveDialog (context,
119- content: appStrings (context).moveImage_message (1 , _images[_page]['name' ], item.name),
120- )) {
121- var response = await moveImage (_images[_page]['id' ], [int .parse (item.id)]);
122- if (response['stat' ] == 'fail' ) {
123- ScaffoldMessenger .of (context).showSnackBar (
124- errorSnackBar (context, response['result' ]));
125- Navigator .of (context).pop ();
126- } else {
127- ScaffoldMessenger .of (context).showSnackBar (
128- imagesMovedSnackBar (context, 1 ));
129- Navigator .of (context).pop ();
130- }
111+ builder: (context) {
112+ return MoveOrCopyDialog (
113+ title: appStrings (context).moveImage_title,
114+ subtitle: appStrings (context).moveImage_selectAlbum (1 , _images[_page]['name' ]),
115+ catId: widget.category,
116+ catName: widget.title,
117+ isImage: true ,
118+ onSelected: (item) async {
119+ if (await confirmMoveDialog (context,
120+ content: appStrings (context).moveImage_message (1 , _images[_page]['name' ], item.name),
121+ )) {
122+ var response = await moveImage (_images[_page]['id' ], [int .parse (item.id)]);
123+ if (response['stat' ] == 'fail' ) {
124+ ScaffoldMessenger .of (context).showSnackBar (
125+ errorSnackBar (context, response['result' ]));
126+ Navigator .of (context).pop ();
127+ } else {
128+ ScaffoldMessenger .of (context).showSnackBar (
129+ imagesMovedSnackBar (context, 1 ));
130+ Navigator .of (context).pop ();
131131 }
132- },
133- );
134- }
132+ }
133+ },
134+ );
135+ },
135136 ).whenComplete (() {
136137 setState (() {});
137138 });
138139 break ;
139140 case 1 : showDialog (context: context,
140- builder: (context) {
141- return MoveOrCopyDialog (
142- title: appStrings (context).copyImage_title,
143- subtitle: appStrings (context).copyImage_selectAlbum (1 , _images[_page]['name' ]),
144- catId: widget.category,
145- catName: widget.title,
146- isImage: true ,
147- onSelected: (item) async {
148- if (await confirmAssignDialog (context,
149- content: appStrings (context).copyImage_message (1 , _images[_page]['name' ], item.name),
150- )) {
151- var response = await assignImage (_images[_page]['id' ], [int .parse (item.id)]);
152- if (response['stat' ] == 'fail' ) {
153- ScaffoldMessenger .of (context).showSnackBar (
154- errorSnackBar (context, response['result' ]));
155- Navigator .of (context).pop ();
156- } else {
157- ScaffoldMessenger .of (context).showSnackBar (
158- imagesAssignedSnackBar (context, 1 ));
159- Navigator .of (context).pop ();
160- }
141+ builder: (context) {
142+ return MoveOrCopyDialog (
143+ title: appStrings (context).copyImage_title,
144+ subtitle: appStrings (context).copyImage_selectAlbum (1 , _images[_page]['name' ]),
145+ catId: widget.category,
146+ catName: widget.title,
147+ isImage: true ,
148+ onSelected: (item) async {
149+ if (await confirmAssignDialog (context,
150+ content: appStrings (context).copyImage_message (1 , _images[_page]['name' ], item.name),
151+ )) {
152+ var response = await assignImage (_images[_page]['id' ], [int .parse (item.id)]);
153+ if (response['stat' ] == 'fail' ) {
154+ ScaffoldMessenger .of (context).showSnackBar (
155+ errorSnackBar (context, response['result' ]));
156+ Navigator .of (context).pop ();
157+ } else {
158+ ScaffoldMessenger .of (context).showSnackBar (
159+ imagesAssignedSnackBar (context, 1 ));
160+ Navigator .of (context).pop ();
161161 }
162- },
163- );
164- }
162+ }
163+ },
164+ );
165+ },
165166 ).whenComplete (() {
166167 setState (() {});
167168 });
0 commit comments