fixed exam subject rename thing
This commit is contained in:
@@ -6,7 +6,8 @@ import 'package:filcnaplo/utils/format.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
|
||||
class ExamTile extends StatelessWidget {
|
||||
const ExamTile(this.exam, {Key? key, this.onTap, this.padding}) : super(key: key);
|
||||
const ExamTile(this.exam, {Key? key, this.onTap, this.padding})
|
||||
: super(key: key);
|
||||
|
||||
final Exam exam;
|
||||
final void Function()? onTap;
|
||||
@@ -22,26 +23,32 @@ class ExamTile extends StatelessWidget {
|
||||
visualDensity: VisualDensity.compact,
|
||||
contentPadding: const EdgeInsets.only(left: 8.0, right: 12.0),
|
||||
onTap: onTap,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)),
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)),
|
||||
leading: SizedBox(
|
||||
width: 44,
|
||||
height: 44,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 2.0),
|
||||
child: Icon(
|
||||
SubjectIcon.resolveVariant(subjectName: exam.subjectName, context: context),
|
||||
SubjectIcon.resolveVariant(
|
||||
subjectName: exam.subject.name, context: context),
|
||||
size: 28.0,
|
||||
color: AppColors.of(context).text.withOpacity(.75),
|
||||
),
|
||||
)),
|
||||
title: Text(
|
||||
exam.description != "" ? exam.description : (exam.mode?.description ?? "Számonkérés"),
|
||||
exam.description != ""
|
||||
? exam.description
|
||||
: (exam.mode?.description ?? "Számonkérés"),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
subtitle: Text(
|
||||
exam.subjectName.capital(),
|
||||
exam.subject.isRenamed
|
||||
? exam.subject.renamedTo!
|
||||
: exam.subject.name.capital(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
|
||||
@@ -29,13 +29,15 @@ class ExamView extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(left: 6.0),
|
||||
child: Icon(
|
||||
SubjectIcon.resolveVariant(
|
||||
subjectName: exam.subjectName, context: context),
|
||||
subjectName: exam.subject.name, context: context),
|
||||
size: 36.0,
|
||||
color: AppColors.of(context).text.withOpacity(.75),
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
exam.subjectName.capital(),
|
||||
exam.subject.isRenamed
|
||||
? exam.subject.renamedTo!
|
||||
: exam.subject.name.capital(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
|
||||
Reference in New Issue
Block a user