feat(ai-scribe): Fix click on response text of AI, dialog to be disappeared
This commit is contained in:
@@ -67,7 +67,6 @@ class AiScribeModalManager {
|
||||
crossAxisAlignment: crossAxisAlignment,
|
||||
onSelectAiScribeSuggestionAction: onSelectAiScribeSuggestionAction,
|
||||
),
|
||||
barrierDismissible: false,
|
||||
barrierColor: AIScribeColors.dialogBarrier,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -39,34 +39,36 @@ class AiScribeModalWidget extends StatelessWidget {
|
||||
))
|
||||
.toList();
|
||||
|
||||
final dialogContent = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: AIScribeSizes.fieldSpacing,
|
||||
children: [
|
||||
if (hasContent)
|
||||
Flexible(
|
||||
child: AiScribeContextMenu(
|
||||
imagePaths: imagePaths,
|
||||
menuActions: menuActions,
|
||||
submenuController: submenuController,
|
||||
onActionSelected: (menuAction) => _onActionSelected(
|
||||
context,
|
||||
menuAction,
|
||||
final dialogContent = PointerInterceptor(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: AIScribeSizes.fieldSpacing,
|
||||
children: [
|
||||
if (hasContent)
|
||||
Flexible(
|
||||
child: AiScribeContextMenu(
|
||||
imagePaths: imagePaths,
|
||||
menuActions: menuActions,
|
||||
submenuController: submenuController,
|
||||
onActionSelected: (menuAction) => _onActionSelected(
|
||||
context,
|
||||
menuAction,
|
||||
),
|
||||
),
|
||||
),
|
||||
MouseRegion(
|
||||
onEnter: (_) => submenuController?.hide(),
|
||||
child: AIScribeBar(
|
||||
imagePaths: imagePaths,
|
||||
onCustomPrompt: (customPrompt) {
|
||||
Navigator.of(context).pop(CustomPromptAction(customPrompt));
|
||||
submenuController?.hide();
|
||||
},
|
||||
),
|
||||
),
|
||||
MouseRegion(
|
||||
onEnter: (_) => submenuController?.hide(),
|
||||
child: AIScribeBar(
|
||||
imagePaths: imagePaths,
|
||||
onCustomPrompt: (customPrompt) {
|
||||
Navigator.of(context).pop(CustomPromptAction(customPrompt));
|
||||
submenuController?.hide();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (buttonPosition != null && buttonSize != null) {
|
||||
@@ -102,18 +104,20 @@ class AiScribeModalWidget extends StatelessWidget {
|
||||
: position.dy;
|
||||
|
||||
return PointerInterceptor(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: Navigator.of(context).pop,
|
||||
child: Stack(
|
||||
children: [
|
||||
PositionedDirectional(
|
||||
start: position.dx,
|
||||
top: top,
|
||||
child: dialogContent,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: Navigator.of(context).pop,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PositionedDirectional(
|
||||
start: position.dx,
|
||||
top: top,
|
||||
child: dialogContent,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -109,23 +109,25 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget> {
|
||||
);
|
||||
|
||||
return PointerInterceptor(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: _handleClickOutside,
|
||||
child: Stack(
|
||||
children: [
|
||||
PositionedDirectional(
|
||||
start: layout.offset.dx,
|
||||
top: layout.top,
|
||||
bottom: layout.bottom,
|
||||
child: _buildModalContainer(
|
||||
width: modalWidth,
|
||||
maxHeight: layout.availableHeight,
|
||||
child: dialogContent,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: _handleClickOutside,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PositionedDirectional(
|
||||
start: layout.offset.dx,
|
||||
top: layout.top,
|
||||
bottom: layout.bottom,
|
||||
child: _buildModalContainer(
|
||||
width: modalWidth,
|
||||
maxHeight: layout.availableHeight,
|
||||
child: dialogContent,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -177,21 +179,23 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget> {
|
||||
required double maxHeight,
|
||||
required Widget child,
|
||||
}) {
|
||||
return Container(
|
||||
width: width,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: AIScribeSizes.suggestionModalMinHeight,
|
||||
maxHeight: maxHeight,
|
||||
),
|
||||
padding: AIScribeSizes.suggestionContentPadding,
|
||||
decoration: BoxDecoration(
|
||||
color: AIScribeColors.background,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AIScribeSizes.menuRadius,
|
||||
return PointerInterceptor(
|
||||
child: Container(
|
||||
width: width,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: AIScribeSizes.suggestionModalMinHeight,
|
||||
maxHeight: maxHeight,
|
||||
),
|
||||
boxShadow: AIScribeShadows.modal,
|
||||
padding: AIScribeSizes.suggestionContentPadding,
|
||||
decoration: BoxDecoration(
|
||||
color: AIScribeColors.background,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AIScribeSizes.menuRadius,
|
||||
),
|
||||
boxShadow: AIScribeShadows.modal,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user