changed everything from filcnaplo to refilc finally

This commit is contained in:
Kima
2024-02-24 20:12:25 +01:00
parent 0d1c7b7143
commit 1171e3aaaf
655 changed files with 38728 additions and 44967 deletions

View File

@@ -0,0 +1,70 @@
import 'package:refilc/helpers/subject.dart';
import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc_kreta_api/models/exam.dart';
import 'package:refilc_mobile_ui/common/round_border_icon.dart';
import 'package:flutter/material.dart';
import 'package:refilc/utils/format.dart';
class ExamTile extends StatelessWidget {
const ExamTile(this.exam,
{super.key, this.onTap, this.padding, this.showSubject = true});
final Exam exam;
final void Function()? onTap;
final EdgeInsetsGeometry? padding;
final bool showSubject;
@override
Widget build(BuildContext context) {
return Material(
type: MaterialType.transparency,
child: Padding(
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0),
child: ListTile(
visualDensity: VisualDensity.compact,
contentPadding: const EdgeInsets.only(left: 8.0, right: 10.0),
onTap: onTap,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)),
leading: RoundBorderIcon(
icon: Icon(
Icons.edit_document,
size: showSubject ? 24.0 : 22.0,
weight: 2.5,
),
padding: showSubject ? 6.0 : 5.0,
width: 1.0,
),
title: Text(
showSubject
? exam.mode?.description ?? 'Számonkérés'
: (exam.description != ""
? exam.description
: (exam.mode?.description ?? "Számonkérés")),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontWeight: FontWeight.w600),
),
subtitle: Text(
showSubject
? (exam.subject.isRenamed
? exam.subject.renamedTo!
: exam.subject.name.capital())
: exam.mode?.description ?? 'Számonkérés',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14.0),
),
trailing: showSubject
? Icon(
SubjectIcon.resolveVariant(
context: context, subject: exam.subject),
color: AppColors.of(context).text.withOpacity(.5),
)
: null,
minLeadingWidth: 0,
),
),
);
}
}

View File

@@ -0,0 +1,76 @@
import 'package:refilc/helpers/subject.dart';
import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc_kreta_api/models/exam.dart';
import 'package:refilc_mobile_ui/common/bottom_card.dart';
import 'package:refilc/utils/format.dart';
import 'package:refilc_mobile_ui/common/detail.dart';
import 'package:flutter/material.dart';
import 'exam_view.i18n.dart';
class ExamView extends StatelessWidget {
const ExamView(this.exam, {super.key});
final Exam exam;
static show(Exam exam, {required BuildContext context}) =>
showBottomCard(context: context, child: ExamView(exam));
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
// Header
ListTile(
leading: Padding(
padding: const EdgeInsets.only(left: 6.0),
child: Icon(
SubjectIcon.resolveVariant(
subject: exam.subject, context: context),
size: 36.0,
color: AppColors.of(context).text.withOpacity(.75),
),
),
title: Text(
exam.subject.isRenamed
? exam.subject.renamedTo!
: exam.subject.name.capital(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontWeight: FontWeight.w600),
),
subtitle: Text(
(exam.teacher.isRenamed
? exam.teacher.renamedTo
: exam.teacher.name) ??
'',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontWeight: FontWeight.w500),
),
trailing: Text(
exam.date.format(context),
style: const TextStyle(fontWeight: FontWeight.w500),
),
),
// Details
if (exam.writeDate.year != 0)
Detail(
title: "date".i18n,
description: exam.writeDate.format(context)),
if (exam.description != "")
Detail(
title: "description".i18n,
description: exam.description,
maxLines: 5),
if (exam.mode != null)
Detail(title: "mode".i18n, description: exam.mode!.description),
],
),
);
}
}

View File

@@ -0,0 +1,27 @@
import 'package:i18n_extension/i18n_extension.dart';
extension Localization on String {
static final _t = Translations.byLocale("hu_hu") +
{
"en_en": {
"date": "Date",
"description": "Description",
"mode": "Type",
},
"hu_hu": {
"date": "Írás ideje",
"description": "Leírás",
"mode": "Típus",
},
"de_de": {
"date": "Prüfungszeit",
"description": "Bezeichnung",
"mode": "Typ",
}
};
String get i18n => localize(this, _t);
String fill(List<Object> params) => localizeFill(this, params);
String plural(int value) => localizePlural(value, this, _t);
String version(Object modifier) => localizeVersion(modifier, this, _t);
}

View File

@@ -0,0 +1,27 @@
import 'package:refilc_kreta_api/models/exam.dart';
import 'package:refilc_mobile_ui/common/viewable.dart';
import 'package:refilc_mobile_ui/common/widgets/card_handle.dart';
import 'package:refilc_mobile_ui/common/widgets/exam/exam_tile.dart';
import 'package:refilc_mobile_ui/common/widgets/exam/exam_view.dart';
import 'package:flutter/material.dart';
class ExamViewable extends StatelessWidget {
const ExamViewable(this.exam,
{super.key, this.showSubject = true, this.tilePadding});
final Exam exam;
final bool showSubject;
final EdgeInsetsGeometry? tilePadding;
@override
Widget build(BuildContext context) {
return Viewable(
tile: ExamTile(
exam,
showSubject: showSubject,
padding: tilePadding,
),
view: CardHandle(child: ExamView(exam)),
);
}
}