diff --git a/airhub_app/lib/pages/device_control_page.dart b/airhub_app/lib/pages/device_control_page.dart index 4a59ac2..ea48e3d 100644 --- a/airhub_app/lib/pages/device_control_page.dart +++ b/airhub_app/lib/pages/device_control_page.dart @@ -474,6 +474,7 @@ class _DeviceControlPageState extends ConsumerState await _addNewBookWithAnimation( title: saveResult['title'] as String? ?? '新故事', content: saveResult['content'] as String? ?? '', + coverUrl: saveResult['cover_url'] as String? ?? '', ); } } @@ -601,6 +602,7 @@ class _DeviceControlPageState extends ConsumerState _addNewBookWithAnimation( title: saveResult['title'] as String? ?? '新故事', content: saveResult['content'] as String? ?? '', + coverUrl: saveResult['cover_url'] as String? ?? '', ); } } @@ -900,7 +902,7 @@ class _DeviceControlPageState extends ConsumerState ); } - Future _addNewBookWithAnimation({String title = '新故事', String content = ''}) async { + Future _addNewBookWithAnimation({String title = '新故事', String content = '', String coverUrl = ''}) async { // Find the first shelf that has space int? targetShelfId; for (final shelf in _shelves) { @@ -923,6 +925,7 @@ class _DeviceControlPageState extends ConsumerState 'title': title, 'content': content, 'shelf_id': targetShelfId, + if (coverUrl.isNotEmpty) 'cover_url': coverUrl, }); // Reload to get the new story await _loadShelves();