Optimize DNS strategy

Fix the problem that the tray is not displayed in some cases

Optimize tray

Update core

Fix some error
This commit is contained in:
chen08209
2024-09-05 08:59:45 +08:00
parent 6e5f1b8e5f
commit 846ec9728f
54 changed files with 903 additions and 391 deletions

View File

@@ -3,23 +3,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class Measure {
Measure.of(this.context);
final TextScaler _textScale;
late BuildContext context;
final _textScaleFactor =
WidgetsBinding.instance.platformDispatcher.textScaleFactor;
Measure.of(this.context) : _textScale = MediaQuery.of(context).textScaler;
Size computeTextSize(Text text) {
final textPainter = TextPainter(
text: TextSpan(text: text.data, style: text.style),
maxLines: text.maxLines,
textScaler: TextScaler.linear(_textScaleFactor),
textScaler: _textScale,
textDirection: text.textDirection ?? TextDirection.ltr,
)..layout();
return textPainter.size;
}
late BuildContext context;
double? _bodyMediumHeight;
double? _bodySmallHeight;
double? _labelSmallHeight;