Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- var list = [
- DateTime.now().add(Duration(days: 3)),
- DateTime.now().add(Duration(days: 2)),
- DateTime.now(),
- DateTime.now().subtract(Duration(days: 1))
- ];
- list.sort((a, b) => a.compareTo(b));
- print(list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement