Refer to Safe.substring
Safe.substring
static String substring(String? string, int start, [int? end]) => Safe.substring(string, start, end);