title: dart - toList() causes the casting exception
body: <p>I'm trying to connect to MongoDB from my code using <code>mongo_dart</code> package.</p>
  <p>So my approach is below,</p>
  <pre><code>import 'package:mongo_dart/mongo_dart.dart';
  
  class MongoDB {
    late Db db;
  
    MongoDB(
        {hosts = const ['myserver1', 'myserver2', 'myserver3'],
        port = '27017',
        username = 'admin',
        password = 'mypassword',
        dbname = 'mydb',
        authSource = 'admin'}) {
      db = Db.pool(
          hosts.map((elem) =&gt; &quot;mongodb://$username:$password@$elem:$port/$dbname?authSource=$authSource&quot;).toList());
    }
  
  </code></pre>
  <p>When executing this code an exception occurs which has the message <code>Expected a value of type 'List&lt;String&gt;', but got one of type 'List&lt;dynamic&gt;'</code> on <code>.toList()</code>.</p>
  <p>All the parameters are string types, but why does it happen?</p>