major property

int? get major

Implementation

int? get major => version == null ? null : int.tryParse(version!.split('.').first);