flutter column values use to return arrray

Issue

flutter datacolumn i m using column header value in direct function

like this

List<String> columnList = ['Name', 'age', 'Type','Expiry Date'];

how to write a function to return this columnList as array

I want to use like

List<String> columnList = columnList();

columnList function how to write it?

Solution

I’m not sure to understand your purpose, but if you want a return type, plz check below.

List<String> columnList() {
   return ['Name', 'age', 'Type','Expiry Date'];
}

Then, you can use "columnList()".

Answered By – Bernard Hur

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *