recentProjects function
Implementation
Future<void> recentProjects() async {
final db = await loadDB();
final recents =
db.entries
.where((e) => (e.value['last_opened'] as String).isNotEmpty)
.toList()
..sort(
(a, b) => DateTime.parse(
b.value['last_opened'],
).compareTo(DateTime.parse(a.value['last_opened'])),
);
if (recents.isEmpty) return print('📂 No recent projects.'.blue);
print('📂 Recently opened:'.blue);
for (var e in recents.take(10)) {
print(' - ${e.key} → ${e.value['last_opened']}');
}
}