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
36 lines
833 B
Dart
36 lines
833 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:firka_common/core/icon_helper.dart';
|
|
import 'package:firka_common/ui/shared/firka_icon.dart';
|
|
|
|
class ClassIconWidget extends StatelessWidget {
|
|
final String _uid;
|
|
final String _className;
|
|
final String _category;
|
|
final Color color;
|
|
final double? size;
|
|
|
|
const ClassIconWidget({
|
|
super.key,
|
|
required String uid,
|
|
required String className,
|
|
required String category,
|
|
this.color = Colors.white,
|
|
this.size,
|
|
}) : _className = className,
|
|
_uid = uid,
|
|
_category = category;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var iconCategory = getIconType(_uid, _className, _category);
|
|
|
|
return FirkaIconWidget(
|
|
FirkaIconType.majesticons,
|
|
getIconData(iconCategory),
|
|
color: color,
|
|
size: size,
|
|
);
|
|
}
|
|
}
|