- Added the `isLeapYear` extension to the `DateTime` and `int` objects.
- Added the `FixedSizeList` class.
This commit is contained in:
2025-05-16 11:15:08 +02:00
parent bfdba4603b
commit 363fb20665
9 changed files with 188 additions and 5 deletions
+12
View File
@@ -258,6 +258,18 @@ The following operations are now available on a `DateTime` object:
final DateTime tomorrow = DateTime(0).tomorrow; // 2024-10-08 00:00:00.000
```
#### Leap Years
- `isLeapYear`: returns a `bool` corresponding to whether a given year is a leap
year. This can also be used directly on an `int`.
```dart
print(DateTime(2024).isLeapYear); // true
print(DateTime(2025).isLeapYear); // false
print(2024.isLeapYear); // true
print(2025.isLeapYear); // false
```
### JWT Parsing
These extensions enhance the `String` class with JWT-specific functionalities,