1

I want to make my font size responsive, but using MediaQuery.textScaleFactorOf(context) does not solve the problem and even throws an error to the console which reads;

Getter not found: 'context'.
fontSize: MediaQuery.textScaleFactorOf(context)*18,
                                     ^^^^^^^

below is my TextStyle code and it is in my build widget.

Text(input, style: TextStyle(
                  fontSize: 18 * MediaQuery.textScaleFactorOf(context),
                  fontFamily: 'Calculator',
                  color: Color(0xFF46595C),
                  fontWeight: FontWeight.bold,
                ),),

0 Answers0