Display Scribe modals correctly when a keyboard is opened
This commit is contained in:
@@ -72,6 +72,10 @@ class AiScribeModalWidget extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (buttonPosition != null && buttonSize != null) {
|
if (buttonPosition != null && buttonSize != null) {
|
||||||
|
final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
final availableHeight = screenSize.height - keyboardHeight;
|
||||||
|
|
||||||
final maxHeightModal = hasContent
|
final maxHeightModal = hasContent
|
||||||
? AIScribeSizes.searchBarMinHeight +
|
? AIScribeSizes.searchBarMinHeight +
|
||||||
AIScribeSizes.fieldSpacing +
|
AIScribeSizes.fieldSpacing +
|
||||||
@@ -81,7 +85,7 @@ class AiScribeModalWidget extends StatelessWidget {
|
|||||||
|
|
||||||
final layoutResult = AnchoredModalLayoutCalculator.calculate(
|
final layoutResult = AnchoredModalLayoutCalculator.calculate(
|
||||||
input: AnchoredModalLayoutInput(
|
input: AnchoredModalLayoutInput(
|
||||||
screenSize: MediaQuery.of(context).size,
|
screenSize: Size(screenSize.width, availableHeight),
|
||||||
anchorPosition: buttonPosition!,
|
anchorPosition: buttonPosition!,
|
||||||
anchorSize: buttonSize!,
|
anchorSize: buttonSize!,
|
||||||
menuSize: Size(
|
menuSize: Size(
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final screenSize = MediaQuery.sizeOf(context);
|
final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
final availableHeight = screenSize.height - keyboardHeight;
|
||||||
|
|
||||||
final modalWidth = min(
|
final modalWidth = min(
|
||||||
screenSize.width * AIScribeSizes.mobileFactor,
|
screenSize.width * AIScribeSizes.mobileFactor,
|
||||||
@@ -57,7 +59,7 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget>
|
|||||||
);
|
);
|
||||||
|
|
||||||
final modalMaxHeight = min(
|
final modalMaxHeight = min(
|
||||||
screenSize.height * AIScribeSizes.mobileFactor,
|
availableHeight * AIScribeSizes.mobileFactor,
|
||||||
AIScribeSizes.suggestionModalMaxHeight,
|
AIScribeSizes.suggestionModalMaxHeight,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget>
|
|||||||
}
|
}
|
||||||
|
|
||||||
final layout = AnchoredModalLayoutCalculator.calculateAnchoredSuggestLayout(
|
final layout = AnchoredModalLayoutCalculator.calculateAnchoredSuggestLayout(
|
||||||
screenSize: screenSize,
|
screenSize: Size(screenSize.width, availableHeight),
|
||||||
anchorPosition: widget.buttonPosition!,
|
anchorPosition: widget.buttonPosition!,
|
||||||
anchorSize: widget.buttonSize!,
|
anchorSize: widget.buttonSize!,
|
||||||
menuSize: Size(modalWidth, modalMaxHeight),
|
menuSize: Size(modalWidth, modalMaxHeight),
|
||||||
|
|||||||
Reference in New Issue
Block a user