|
...
|
...
|
@@ -32,6 +32,7 @@ class CreateWatchThemeController extends GetxController { |
|
|
|
final isSaving = false.obs;
|
|
|
|
final List<int> _imageTaskVersions = List<int>.filled(4, 0);
|
|
|
|
bool _isClosed = false;
|
|
|
|
bool _creationCompleted = false;
|
|
|
|
late final TextEditingController themeNameController;
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -199,6 +200,9 @@ class CreateWatchThemeController extends GetxController { |
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> handleCreateBack() async {
|
|
|
|
if (_creationCompleted) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (customThemeName.value.isEmpty &&
|
|
|
|
!customImagePaths.any((path) => path != null && path.isNotEmpty)) {
|
|
|
|
Get.back();
|
|
...
|
...
|
@@ -260,12 +264,16 @@ class CreateWatchThemeController extends GetxController { |
|
|
|
}
|
|
|
|
|
|
|
|
final createdTheme = await _loadCreatedTheme();
|
|
|
|
await Get.offAndToNamed(
|
|
|
|
Routes.WATCH_THEME_CUSTOM_PREVIEW,
|
|
|
|
arguments: {
|
|
|
|
'theme': createdTheme ?? _buildThemeItem(uploadedImageUrls),
|
|
|
|
},
|
|
|
|
_creationCompleted = true;
|
|
|
|
unawaited(
|
|
|
|
Get.offNamed(
|
|
|
|
Routes.WATCH_THEME_CUSTOM_PREVIEW,
|
|
|
|
arguments: {
|
|
|
|
'theme': createdTheme ?? _buildThemeItem(uploadedImageUrls),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
} catch (_) {
|
|
|
|
AppToast.show('创建表盘失败,请重试');
|
|
|
|
} finally {
|
...
|
...
|
|