mod: flutter 3.16 特性迁移

This commit is contained in:
guozhigq
2024-01-21 18:50:25 +08:00
parent 9e40e162ac
commit 7428cde108
11 changed files with 20 additions and 21 deletions

View File

@ -224,7 +224,7 @@ class _BangumiPageState extends State<BangumiPage>
// 列数
crossAxisCount: 3,
mainAxisExtent: Get.size.width / 3 / 0.65 +
32 * MediaQuery.of(context).textScaleFactor,
MediaQuery.textScalerOf(context).scale(32.0),
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {

View File

@ -162,8 +162,9 @@ class _LivePageState extends State<LivePage>
crossAxisCount: crossAxisCount,
mainAxisExtent:
Get.size.width / crossAxisCount / StyleString.aspectRatio +
(crossAxisCount == 1 ? 48 : 68) *
MediaQuery.of(context).textScaleFactor,
MediaQuery.textScalerOf(context).scale(
(crossAxisCount == 1 ? 48 : 68),
),
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {

View File

@ -163,7 +163,7 @@ class _MediaPageState extends State<MediaPage>
// const SizedBox(height: 10),
SizedBox(
width: double.infinity,
height: 200 * MediaQuery.of(context).textScaleFactor,
height: MediaQuery.textScalerOf(context).scale(200),
child: FutureBuilder(
future: _futureBuilderFuture,
builder: (context, snapshot) {

View File

@ -26,10 +26,9 @@ Widget searchArticlePanel(BuildContext context, ctr, list) {
StyleString.safeSpace, 5, StyleString.safeSpace, 5),
child: LayoutBuilder(builder: (context, boxConstraints) {
double width = (boxConstraints.maxWidth -
StyleString.cardSpace *
6 /
MediaQuery.of(context).textScaleFactor) /
2;
StyleString.cardSpace *
6 /
MediaQuery.textScalerOf(context).scale(2.0));
return Container(
constraints: const BoxConstraints(minHeight: 88),
height: width / StyleString.aspectRatio,

View File

@ -17,7 +17,7 @@ Widget searchLivePanel(BuildContext context, ctr, list) {
mainAxisSpacing: StyleString.cardSpace + 3,
mainAxisExtent:
MediaQuery.sizeOf(context).width / 2 / StyleString.aspectRatio +
66 * MediaQuery.of(context).textScaleFactor),
MediaQuery.textScalerOf(context).scale(66.0)),
itemCount: list.length,
itemBuilder: (context, index) {
return LiveItem(liveItem: list![index]);

View File

@ -67,11 +67,11 @@ Widget searchMbangumiPanel(BuildContext context, ctr, list) {
TextSpan(
text: i['text'],
style: TextStyle(
fontSize: Theme.of(context)
fontSize: MediaQuery.textScalerOf(context)
.scale(Theme.of(context)
.textTheme
.titleSmall!
.fontSize! *
MediaQuery.of(context).textScaleFactor,
.fontSize!),
fontWeight: FontWeight.bold,
color: i['type'] == 'em'
? Theme.of(context).colorScheme.primary