grade value nocolor

This commit is contained in:
55nknown 2022-11-20 20:18:58 +01:00
parent 36bd679644
commit 30ac155b4b
3 changed files with 13 additions and 9 deletions

View File

@ -129,6 +129,7 @@ class GradeValueWidget extends StatelessWidget {
this.shadow = false, this.shadow = false,
this.outline = false, this.outline = false,
this.complemented = false, this.complemented = false,
this.nocolor = false,
}) : super(key: key); }) : super(key: key);
final GradeValue value; final GradeValue value;
@ -138,13 +139,14 @@ class GradeValueWidget extends StatelessWidget {
final bool shadow; final bool shadow;
final bool outline; final bool outline;
final bool complemented; final bool complemented;
final bool nocolor;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
GradeValue value = Provider.of<SettingsProvider>(context).goodStudent ? GradeValue(5, "Példás", "Példás", this.value.weight) : this.value; GradeValue value = Provider.of<SettingsProvider>(context).goodStudent ? GradeValue(5, "Példás", "Példás", this.value.weight) : this.value;
bool isSubjectView = SubjectGradesContainer.of(context) != null; bool isSubjectView = SubjectGradesContainer.of(context) != null;
Color color = gradeColor(context: context, value: value.value); Color color = gradeColor(context: context, value: value.value, nocolor: nocolor);
Widget valueText; Widget valueText;
final percentage = value.percentage; final percentage = value.percentage;
@ -166,7 +168,9 @@ class GradeValueWidget extends StatelessWidget {
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} else if (value.value != 0) { } else if (value.valueName.toLowerCase().specialChars() == 'nem irt') {
valueText = const Icon(FeatherIcons.slash);
} else {
valueText = Stack(alignment: Alignment.topRight, children: [ valueText = Stack(alignment: Alignment.topRight, children: [
Transform.translate( Transform.translate(
offset: (value.weight >= 200) ? const Offset(2, 1.5) : Offset.zero, offset: (value.weight >= 200) ? const Offset(2, 1.5) : Offset.zero,
@ -196,10 +200,6 @@ class GradeValueWidget extends StatelessWidget {
), ),
), ),
]); ]);
} else if (value.valueName.toLowerCase().specialChars() == 'nem irt') {
valueText = const Icon(FeatherIcons.slash);
} else {
valueText = const Icon(FeatherIcons.type);
} }
return fill return fill
@ -223,7 +223,7 @@ class GradeValueWidget extends StatelessWidget {
} }
} }
Color gradeColor({required BuildContext context, required num value}) { Color gradeColor({required BuildContext context, required num value, bool nocolor = false}) {
int valueInt = 0; int valueInt = 0;
var settings = Provider.of<SettingsProvider>(context, listen: false); var settings = Provider.of<SettingsProvider>(context, listen: false);
@ -236,6 +236,8 @@ Color gradeColor({required BuildContext context, required num value}) {
} }
} catch (_) {} } catch (_) {}
if (nocolor) return AppColors.of(context).text;
switch (valueInt) { switch (valueInt) {
case 5: case 5:
return settings.gradeColors[4]; return settings.gradeColors[4];

View File

@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
homepage: https://filcnaplo.hu homepage: https://filcnaplo.hu
publish_to: "none" publish_to: "none"
version: 3.3.4+168 version: 3.4.0+169
environment: environment:
sdk: ">=2.16.0-80.1.beta <3.0.0" sdk: ">=2.16.0-80.1.beta <3.0.0"
@ -53,6 +53,8 @@ dependencies:
lottie: ^1.4.3 lottie: ^1.4.3
rive: ^0.9.1 rive: ^0.9.1
animated_background: ^2.0.0 animated_background: ^2.0.0
dropdown_button2: ^1.8.9
home_widget: ^0.1.6
flutter_expandable_fab: flutter_expandable_fab:
git: git:
url: https://github.com/filc/flutter_expandable_fab url: https://github.com/filc/flutter_expandable_fab

@ -1 +1 @@
Subproject commit ea41ee168fc3b1cac9d3c760edc4e5fd7c391d1f Subproject commit fbe173d323a88d5860dcc93a26c7bc9e77d258cf