forked from firka/firka
- Create firka_common package with core helpers (debug, json, icon), theme, and shared widgets (FirkaCard, FirkaShadow, GradeWidget, GradeSmallCard, ClassIconWidget, FirkaIconWidget, DelayedSpinnerWidget, CounterDigitWidget) - Keep Isar models (GenericCacheModel, TimetableCacheModel, HomeworkCacheModel, DatedCacheEntry, util) in firka and firka_wear - not moved to firka_common - Update firka and firka_wear to depend on firka_common for shared UI only - Add configurable roundGrade thresholds for firka settings - Add package param to FirkaIconWidget for app asset paths
20 lines
438 B
Dart
20 lines
438 B
Dart
extension IterableExtensionMap on Iterable<MapEntry<String, dynamic>> {
|
|
Map<String, dynamic> toMap() {
|
|
var map = <String, dynamic>{};
|
|
for (var item in this) {
|
|
map[item.key] = item.value;
|
|
}
|
|
|
|
return map;
|
|
}
|
|
}
|
|
|
|
extension IterableExtension<T> on Iterable<T> {
|
|
T? firstWhereOrNull(bool Function(T element) test) {
|
|
for (var element in this) {
|
|
if (test(element)) return element;
|
|
}
|
|
return null;
|
|
}
|
|
}
|