Today, I happened to find that on iOS devices, when the font size of red copper was set to be very large, the font changed greatly in app, which would cause the text in flutter to break lines. It’s not a bug, but it affects app aesthetics. In order to prevent the app font from changing according to the font size of the system, the following processing methods are specially found: 1. The single Text setting does not follow the system Text

Text(
     // The multiples can be set by themselves
     textScaleFactor: 1.0.'xxxxxxxx'.style: TextStyle(fontSize: 14.color: Color(0xFFFF491C)),
     maxLines: 1,),Copy the code

2. If you want to set the font of the entire app, it is naturally impossible to set one Text by one Text. The global Settings are as follows

// In the main function, set builder
MaterialApp(
    home: xxxxx,
    builder: (context, widget) {
	    return MediaQuery(
		   /// The text size does not change with system Settings
		   data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
		   child: widget, ); },),Copy the code

This is the flutter solution to solve the font following system changes.