Skip to content

Commit

Permalink
Un-emptied the Iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Mar 23, 2024
1 parent aa088cf commit dbfdca5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
10 changes: 6 additions & 4 deletions lib/interface/cupertino/pages/grades.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ class _GradesPageState extends State<GradesPage> {
margin: EdgeInsets.symmetric(horizontal: 5),
child: Opacity(
opacity: 0.5,
child: Text(Share.session.data.student.subjects
.where((x) => x.hasMajor)
.average((x) => x.topMajor!.asValue)
.toStringAsFixed(2)))))
child: Text(() {
var majors = Share.session.data.student.subjects
.where((x) => x.hasMajor)
.select((x, _) => x.topMajor!.asValue);
return majors.isNotEmpty ? majors.average().toStringAsFixed(2) : 'Unavailable';
}()))))
],
),
searchQuery.isEmpty && Share.session.data.student.subjects.any((x) => x.hasMajor))
Expand Down
15 changes: 10 additions & 5 deletions lib/interface/cupertino/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ class _SettingsPageState extends State<SettingsPage> {
margin: EdgeInsets.symmetric(horizontal: 5),
child: Opacity(
opacity: 0.5,
child: Text(Share.session.data.student.subjects
.where((x) => x.hasMajor)
.average((x) => x.topMajor!.asValue)
.toStringAsFixed(2))))),
child: Text(() {
var majors = Share.session.data.student.subjects
.where((x) => x.hasMajor)
.select((x, _) => x.topMajor!.asValue);
return majors.isNotEmpty
? majors.average().toStringAsFixed(2)
: 'Unavailable';
}())))),
CupertinoListTile(
title: Text('Wasted time', overflow: TextOverflow.ellipsis),
trailing: Container(
Expand Down Expand Up @@ -614,7 +618,8 @@ class _SettingsPageState extends State<SettingsPage> {
footer: Container(margin: EdgeInsets.symmetric(horizontal: 20)),
children: [
GestureDetector(
onTap: () => launchUrlString('https://github.com/szkolny-eu/szkolny-android'),
onTap: () =>
launchUrlString('https://github.com/szkolny-eu/szkolny-android'),
child: Image.network(
'https://github.com/szkolny-eu/szkolny-android/blob/develop/.github/readme-banner.png?raw=true')),
]),
Expand Down

0 comments on commit dbfdca5

Please sign in to comment.