how to make list dynamic from object in flutter code example

Example 1: flutter convert list dynamic to list string

// succeeds - is dynamic
// gives List<dynamic> 
var target_list_1 = [] + str_list;

// succeeds - is dynamic
// gives List<dynamic> 
var target_list_2 = List<dynamic>.from(str_list);

Example 2: dynamic listview to do list flutter

// A Separate Function called from itemBuilderWidget buildBody(BuildContext ctxt, int index) {  return new Text(litems[index]);}body: new ListView.builder(  itemCount: litems.length,  itemBuilder: (BuildContext ctxt, int index) => buildBody(ctxt, index)),

Tags:

Dart Example