double? parseIntOrDoubleAsDouble(dynamic value) { if (value == null) return null; if (value is double) return value; if (value is int) return value * 1.0; return null; } List parseAsDoubleList(List inputList) { if (inputList.isEmpty) return const []; if (inputList is List) return inputList; return List.generate( inputList.length, (index) { final value = inputList[index]; if (value is int) return value.toDouble(); if (value is double) return value; throw FormatException( 'Invalid type at index $index: ${value.runtimeType}', ); }, growable: false, ); }