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? please suggest me
CodePudding user response:
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()".
CodePudding user response:
Dart arrays are actually Lists. So columnList here is an array too. Simple return it as array