1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-30 00:36:28 +00:00
comunicmobile/lib/utils/api_utils.dart

11 lines
240 B
Dart
Raw Normal View History

2020-04-15 10:04:19 +00:00
/// API utilities
///
/// @author Pierre Hubert
/// Casting helper
T? cast<T>(dynamic val) => val is T ? val : null;
2020-05-01 18:15:28 +00:00
/// Turn null and "null" into ""
String nullToEmpty(String? input) =>
2020-05-01 18:15:28 +00:00
input == null || input == "null" ? "" : input;