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