fix: dispose TextPainter after use (#1777)
This commit is contained in:
parent
a218591805
commit
cd0650f6b7
3 changed files with 7 additions and 3 deletions
|
|
@ -48,7 +48,7 @@ class MorphInfoRepo {
|
|||
set(request, response);
|
||||
|
||||
return response;
|
||||
} catch (e, s) {
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching morph info: $e');
|
||||
return Future.error(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ class MorphologicalFeature {
|
|||
|
||||
MorphologicalTag? getTagByCode(String code) {
|
||||
return tags.firstWhereOrNull(
|
||||
(tag) => tag.code.toLowerCase() == code.toLowerCase());
|
||||
(tag) => tag.code.toLowerCase() == code.toLowerCase(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -107,6 +108,7 @@ class MorphInfoResponse {
|
|||
|
||||
MorphologicalFeature? getFeatureByCode(String code) {
|
||||
return features.firstWhereOrNull(
|
||||
(feature) => feature.code.toLowerCase() == code.toLowerCase());
|
||||
(feature) => feature.code.toLowerCase() == code.toLowerCase(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ class HiddenText extends StatelessWidget {
|
|||
final textWidth = textPainter.size.width;
|
||||
final textHeight = textPainter.size.height;
|
||||
|
||||
textPainter.dispose();
|
||||
|
||||
return SizedBox(
|
||||
height: textHeight,
|
||||
child: Stack(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue