From bf53612c42af7f4c405d50ceb958ef60f9c5b06b Mon Sep 17 00:00:00 2001 From: niuhuan Date: Sat, 20 Nov 2021 08:11:26 +0800 Subject: [PATCH] wrap's title font size --- lib/screens/components/ComicList.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/screens/components/ComicList.dart b/lib/screens/components/ComicList.dart index c0d8074..07c783d 100644 --- a/lib/screens/components/ComicList.dart +++ b/lib/screens/components/ComicList.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:event/event.dart'; import 'package:flutter/material.dart'; import 'package:pikapika/basic/Common.dart'; @@ -208,6 +210,8 @@ class _ComicListState extends State { int rowCap = size.width ~/ widthAndGap; var width = widthAndGap - gap * 2; var height = width * coverHeight / coverWidth; + double titleFontSize = max(width / 11, 10); + double shadowFontSize = max(width / 9, 12); List wraps = []; List tmp = []; widget.comicList.forEach((e) { @@ -229,7 +233,7 @@ class _ComicListState extends State { '被封印的本子', textAlign: TextAlign.center, style: TextStyle( - fontSize: 12, + fontSize: shadowFontSize, color: (Theme.of(context).textTheme.bodyText1?.color ?? Colors.black) .withOpacity(.5), @@ -265,7 +269,7 @@ class _ComicListState extends State { e.title + '\n', style: TextStyle( color: Colors.white, - fontSize: 10, + fontSize: titleFontSize, height: 1.2, ), strutStyle: StrutStyle(height: 1.2),