new: setting of termCursor type

This commit is contained in:
lollipopkit
2024-03-08 02:03:11 -06:00
parent b9aa4ba124
commit 2ddc29f45e
14 changed files with 209 additions and 298 deletions

View File

@@ -0,0 +1,12 @@
extension EnumListX<T> on List<T> {
T fromIndex(int index, [T? defaultValue]) {
try {
return this[index];
} catch (e) {
if (defaultValue != null) {
return defaultValue;
}
throw Exception('Invalid index: $index');
}
}
}