Do not display Scribe actions if no content in composer in mobile
This commit is contained in:
@@ -22,6 +22,7 @@ class AiScribeModalManager {
|
||||
if (PlatformInfo.isMobile) {
|
||||
aiAction = await showMobileAIScribeMenuModal(
|
||||
imagePaths: imagePaths,
|
||||
content: content,
|
||||
availableCategories: availableCategories,
|
||||
);
|
||||
} else {
|
||||
@@ -93,6 +94,7 @@ class AiScribeModalManager {
|
||||
static Future<AIAction?> showMobileAIScribeMenuModal({
|
||||
required ImagePaths imagePaths,
|
||||
required List<AIScribeMenuCategory> availableCategories,
|
||||
String? content,
|
||||
}) async {
|
||||
final context = Get.context;
|
||||
|
||||
@@ -105,6 +107,7 @@ class AiScribeModalManager {
|
||||
builder: (context) => AiScribeMobileActionsBottomSheet(
|
||||
imagePaths: imagePaths,
|
||||
availableCategories: availableCategories,
|
||||
content: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+14
-9
@@ -7,11 +7,13 @@ import 'package:scribe/scribe.dart';
|
||||
class AiScribeMobileActionsBottomSheet extends StatefulWidget {
|
||||
final ImagePaths imagePaths;
|
||||
final List<AIScribeMenuCategory> availableCategories;
|
||||
final String? content;
|
||||
|
||||
const AiScribeMobileActionsBottomSheet({
|
||||
super.key,
|
||||
required this.imagePaths,
|
||||
required this.availableCategories,
|
||||
this.content,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -164,6 +166,8 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
widget.imagePaths,
|
||||
))
|
||||
.toList();
|
||||
|
||||
final hasContent = widget.content?.isNotEmpty ?? false;
|
||||
|
||||
return Container(
|
||||
height: double.infinity,
|
||||
@@ -181,16 +185,17 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_buildHeader(context, localizations),
|
||||
Flexible(
|
||||
child: ValueListenableBuilder<AiScribeCategoryContextMenuAction?>(
|
||||
valueListenable: _selectedCategory,
|
||||
builder: (context, selectedCategory, _) {
|
||||
return selectedCategory == null
|
||||
? _buildMenuListView(menuActions)
|
||||
: _buildSubmenuListView();
|
||||
},
|
||||
if(hasContent)
|
||||
Flexible(
|
||||
child: ValueListenableBuilder<AiScribeCategoryContextMenuAction?>(
|
||||
valueListenable: _selectedCategory,
|
||||
builder: (context, selectedCategory, _) {
|
||||
return selectedCategory == null
|
||||
? _buildMenuListView(menuActions)
|
||||
: _buildSubmenuListView();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user