【发布时间】:2022-01-14 03:18:00
【问题描述】:
我正在使用 Google 字体设计的 Text,并且工作正常,但是当我在 Text 之前添加 const 时,我得到 Invalid Constant Value Error
下面是我在没有 const 的情况下是如何实现的
Text(
'Voila',
style: GoogleFonts.dawningOfANewDay(fontSize: 30),
),
下面是我尝试用 const 实现的方法
const Text(
'Voila',
style: GoogleFonts.dawningOfANewDay(fontSize: 30),
),
以下是我如何尝试使 google 字体保持不变,但错误仍然存在
const Text(
'Voila',
style: const GoogleFonts.dawningOfANewDay(fontSize: 30),
)
【问题讨论】:
标签: flutter google-fonts flutter-text