feat(ai-scribe): Fix the English locale file `(intl_en.arb)` is missing all three AI Scribe keys
feat(ai-scribe): Fix async function declared without proper return type annotation. feat(ai-scribe): Fix Async operations not properly awaited. feat(ai-scribe): Fix inconsistent capitalization between button labels. feat(ai-scribe): Fix GenerateAITextFailure check will never match. feat(ai-scribe): Fix consider validating text input for predefined actions. feat(ai-scribe): Using a subshell for directory isolation. feat(ai-scribe): Fix verify the mock usage or document intent. feat(ai-scribe): Using a more conventional import for Offset. feat(ai-scribe): Adding error handling for consistency feat(ai-scribe): Remove `fromJson` and `toJson` of AIResponse feat(ai-scribe): Using constants for role values. feat(ai-scribe): Using a more specific import. feat(ai-scribe): Using Timer for cleaner lifecycle management feat(ai-scribe): Adding error handling to fromMap() for consistency. feat(ai-scribe): Disposing the ValueNotifier feat(ai-scribe): Redundant null check after assignment feat(ai-scribe): Fix calling `registerSelectionChangeListener` multiple times may be inefficient. feat(ai-scribe): Safer type handling for JavaScript callback args feat(ai-scribe): Fix async callbacks not awaited in switch statement. feat(ai-scribe): Fix binding lifecycle mismatch for GetAIScribeConfigInteractor feat(ai-scribe): Fix ai prompts feat(ai-scribe): Fix unawaited async call to `_setupSelectionListener` feat(ai-scribe): Fix switch cases use top-origin coordinates while `PositionedDirectional(bottom:)`` expects bottom-origin coordinates. feat(ai-scribe): Adding error handling for selection listener setup.
This commit is contained in:
@@ -58,12 +58,21 @@ class TextSelectionCoordinates {
|
||||
});
|
||||
|
||||
factory TextSelectionCoordinates.fromMap(Map<dynamic, dynamic> data) {
|
||||
return TextSelectionCoordinates(
|
||||
x: (data['x'] as num?)?.toDouble() ?? 0.0,
|
||||
y: (data['y'] as num?)?.toDouble() ?? 0.0,
|
||||
width: (data['width'] as num?)?.toDouble() ?? 0.0,
|
||||
height: (data['height'] as num?)?.toDouble() ?? 0.0,
|
||||
);
|
||||
try {
|
||||
return TextSelectionCoordinates(
|
||||
x: (data['x'] as num?)?.toDouble() ?? 0.0,
|
||||
y: (data['y'] as num?)?.toDouble() ?? 0.0,
|
||||
width: (data['width'] as num?)?.toDouble() ?? 0.0,
|
||||
height: (data['height'] as num?)?.toDouble() ?? 0.0,
|
||||
);
|
||||
} catch (e) {
|
||||
return const TextSelectionCoordinates(
|
||||
x: 0.0,
|
||||
y: 0.0,
|
||||
width: 0.0,
|
||||
height: 0.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Offset get position => Offset(x, y);
|
||||
|
||||
Reference in New Issue
Block a user