parseListDynamicToInt static method

List<int> parseListDynamicToInt(
  1. List in_list
)

Implementation

static List<int> parseListDynamicToInt(List<dynamic> in_list) {
  List<int> ids = [];
  for (int i = 0; i < in_list.length; ++i) {
    final item = in_list[i];
    if (item is int) {
      ids.add(item);
    } else {
      final intItem = int.tryParse(item.toString());
      if (null != intItem) {
        ids.add(intItem);
      }
    }
  }
  return ids;
}