title: How do I auto scale down a font in a Text widget to fit the max number of lines?
body: <p>I'm trying to use <code>BoxFit.scaleDown</code> in a <code>FittedBox</code>'s fit property to scale the font down in a <code>Text</code> widget to accommodate strings of varying length.</p>
  
  <p>However, the below code will scale down the entire string and make it fit on one line, For the below example, I would like the font scaled down so that the string can fit on two lines (per <code>maxLines</code> property of the <code>Text</code> widget).</p>
  
  <p><a href="https://i.stack.imgur.com/7NRwJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7NRwJ.png" alt="enter image description here"></a></p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(new MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Multi-Line Label Demo',
        theme: new ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: new MyHomePage(title: 'Multi-Line Label Demo'),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; new _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    @override
    Widget build(BuildContext context) {
      final textStyle = const TextStyle(fontSize: 28.0);
      final text =
          'Lorem Ipsum is simply dummy text of the printing and typesetting'
          'industry. Lorem Ipsum has been the industry\'s standard dummy text'
          'ever since the 1500s, when an unknown printer took a galley of type'
          'and scrambled it to make a type specimen book.';
      return new Scaffold(
        appBar: new AppBar(
          title: new Text(widget.title),
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              new FittedBox(
                fit: BoxFit.scaleDown,
                child: new Text(
                  text,
                  maxLines: 2,
                  style: textStyle,
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>