1
0
forked from firka/firka

feat: omission card icon

This commit is contained in:
checkedear
2026-06-15 12:14:52 +02:00
parent c0f3e61b90
commit c8b402118c
4 changed files with 46 additions and 10 deletions

View File

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.7069 7.70643C19.8891 7.51783 19.9899 7.26523 19.9876 7.00303C19.9853 6.74083 19.8801 6.49002 19.6947 6.30461C19.5093 6.1192 19.2585 6.01403 18.9963 6.01176C18.7341 6.00948 18.4815 6.11027 18.2929 6.29243L8.99992 15.5854L5.70692 12.2924C5.51832 12.1103 5.26571 12.0095 5.00352 12.0118C4.74132 12.014 4.49051 12.1192 4.3051 12.3046C4.11969 12.49 4.01452 12.7408 4.01224 13.003C4.00997 13.2652 4.11076 13.5178 4.29292 13.7064L8.29292 17.7064C8.48045 17.8939 8.73476 17.9992 8.99992 17.9992C9.26508 17.9992 9.51939 17.8939 9.70692 17.7064L19.7069 7.70643Z" fill="#A7DC22"/>
</svg>

After

Width:  |  Height:  |  Size: 726 B

View File

@@ -0,0 +1,10 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2679_4048)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 0.5C1.96957 0.5 1.46086 0.710714 1.08579 1.08579C0.710714 1.46086 0.5 1.96957 0.5 2.5V9.5C0.5 10.0304 0.710714 10.5391 1.08579 10.9142C1.46086 11.2893 1.96957 11.5 2.5 11.5H9.5C10.0304 11.5 10.5391 11.2893 10.9142 10.9142C11.2893 10.5391 11.5 10.0304 11.5 9.5V2.5C11.5 1.96957 11.2893 1.46086 10.9142 1.08579C10.5391 0.710714 10.0304 0.5 9.5 0.5H2.5ZM9.8535 3.8535C9.94458 3.7592 9.99498 3.6329 9.99384 3.5018C9.9927 3.3707 9.94011 3.24529 9.84741 3.15259C9.75471 3.05989 9.6293 3.0073 9.4982 3.00616C9.3671 3.00502 9.2408 3.05542 9.1465 3.1465L4.5 7.793L2.8535 6.1465C2.7592 6.05542 2.6329 6.00502 2.5018 6.00616C2.3707 6.0073 2.24529 6.05989 2.15259 6.15259C2.05989 6.24529 2.0073 6.3707 2.00616 6.5018C2.00502 6.6329 2.05542 6.7592 2.1465 6.8535L4.1465 8.8535C4.24026 8.94724 4.36742 8.99989 4.5 8.99989C4.63258 8.99989 4.75974 8.94724 4.8535 8.8535L9.8535 3.8535Z" fill="#A7DC22"/>
</g>
<defs>
<clipPath id="clip0_2679_4048">
<rect width="12" height="12" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -112,7 +112,7 @@ class _HomeOmissionsScreen extends FirkaState<HomeOmissionsScreen> {
children: [
FirkaIconWidget(
FirkaIconType.majesticonsLocal,
"check",
"checkSolid",
size: 12.0,
color: appStyle.colors.accent,
),
@@ -269,7 +269,7 @@ class _HomeOmissionsScreen extends FirkaState<HomeOmissionsScreen> {
children: [
FirkaIconWidget(
FirkaIconType.majesticonsLocal,
"check",
"checkSolid",
size: 12.0,
color: appStyle.colors.accent,
),

View File

@@ -107,29 +107,52 @@ class InfoCard extends StatelessWidget {
factory InfoCard.omission(List<Omission> omissions) {
String title = "-";
Color color = appStyle.colors.accent;
FirkaIconType iconType = FirkaIconType.majesticons;
Object iconData = "check";
for (final state in [
OmissionState.pending,
OmissionState.unexcused,
OmissionState.excused,
(
OmissionState.pending,
appStyle.colors.warningAccent,
FirkaIconType.majesticons,
Majesticon.timerSolid,
),
(
OmissionState.unexcused,
appStyle.colors.errorAccent,
FirkaIconType.majesticons,
Majesticon.restrictedLine,
),
(
OmissionState.excused,
appStyle.colors.accent,
FirkaIconType.majesticonsLocal,
"check",
),
]) {
final count = omissions.where((o) => o.state == state).length;
final count = omissions.where((o) => o.state == state.$1).length;
if (count == 0) {
continue;
}
title = initData.l10n.omissions_count(state.name, count);
title = initData.l10n.omissions_count(state.$1.name, count);
color = state.$2;
iconType = state.$3;
iconData = state.$4;
break;
}
return InfoCard(
icon: FilledCircle(
diameter: 36,
color: appStyle.colors.a15p,
child: SizedBox(),
color: color.withAlpha(38),
child: FirkaIconWidget(iconType, iconData, color: color, size: 24),
),
texts: [
title,
DateFormat.MMMMd(initData.l10n.localeName).format(omissions.first.date),
DateFormat.MMMMd(
initData.l10n.localeName,
).format(omissions.first.date).firstUpper(),
],
onTap: (context) =>
showOmissionBottomSheet(context, initData, title, omissions),