|
@@ -32,6 +32,7 @@ class CreateWatchThemeController extends GetxController { |
|
@@ -32,6 +32,7 @@ class CreateWatchThemeController extends GetxController { |
|
32
|
final isSaving = false.obs;
|
32
|
final isSaving = false.obs;
|
|
33
|
final List<int> _imageTaskVersions = List<int>.filled(4, 0);
|
33
|
final List<int> _imageTaskVersions = List<int>.filled(4, 0);
|
|
34
|
bool _isClosed = false;
|
34
|
bool _isClosed = false;
|
|
|
|
35
|
+ bool _creationCompleted = false;
|
|
35
|
late final TextEditingController themeNameController;
|
36
|
late final TextEditingController themeNameController;
|
|
36
|
|
37
|
|
|
37
|
@override
|
38
|
@override
|
|
@@ -199,6 +200,9 @@ class CreateWatchThemeController extends GetxController { |
|
@@ -199,6 +200,9 @@ class CreateWatchThemeController extends GetxController { |
|
199
|
}
|
200
|
}
|
|
200
|
|
201
|
|
|
201
|
Future<void> handleCreateBack() async {
|
202
|
Future<void> handleCreateBack() async {
|
|
|
|
203
|
+ if (_creationCompleted) {
|
|
|
|
204
|
+ return;
|
|
|
|
205
|
+ }
|
|
202
|
if (customThemeName.value.isEmpty &&
|
206
|
if (customThemeName.value.isEmpty &&
|
|
203
|
!customImagePaths.any((path) => path != null && path.isNotEmpty)) {
|
207
|
!customImagePaths.any((path) => path != null && path.isNotEmpty)) {
|
|
204
|
Get.back();
|
208
|
Get.back();
|
|
@@ -260,12 +264,16 @@ class CreateWatchThemeController extends GetxController { |
|
@@ -260,12 +264,16 @@ class CreateWatchThemeController extends GetxController { |
|
260
|
}
|
264
|
}
|
|
261
|
|
265
|
|
|
262
|
final createdTheme = await _loadCreatedTheme();
|
266
|
final createdTheme = await _loadCreatedTheme();
|
|
263
|
- await Get.offAndToNamed(
|
|
|
|
264
|
- Routes.WATCH_THEME_CUSTOM_PREVIEW,
|
|
|
|
265
|
- arguments: {
|
|
|
|
266
|
- 'theme': createdTheme ?? _buildThemeItem(uploadedImageUrls),
|
|
|
|
267
|
- },
|
267
|
+ _creationCompleted = true;
|
|
|
|
268
|
+ unawaited(
|
|
|
|
269
|
+ Get.offNamed(
|
|
|
|
270
|
+ Routes.WATCH_THEME_CUSTOM_PREVIEW,
|
|
|
|
271
|
+ arguments: {
|
|
|
|
272
|
+ 'theme': createdTheme ?? _buildThemeItem(uploadedImageUrls),
|
|
|
|
273
|
+ },
|
|
|
|
274
|
+ ),
|
|
268
|
);
|
275
|
);
|
|
|
|
276
|
+ return;
|
|
269
|
} catch (_) {
|
277
|
} catch (_) {
|
|
270
|
AppToast.show('创建表盘失败,请重试');
|
278
|
AppToast.show('创建表盘失败,请重试');
|
|
271
|
} finally {
|
279
|
} finally {
|