Skip to content

Commit 98605c3

Browse files
Bugfix/overscroll color (#163)
* fixed overscroll color * changed overscroll behavior, was not the width of parent * fixed grades higher than 100% error * fixed error message when grades not available * updated version * added test for isBusy
1 parent eeab4ef commit 98605c3

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

lib/core/managers/course_repository.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ class CourseRepository {
318318
_logger.d("$tag - getCourseSummary: fetched ${course.acronym} summary.");
319319
} on Exception catch (e, stacktrace) {
320320
if (e is ApiException) {
321-
if (e.errorCode == SignetsError.gradesEmpty) {
321+
if (e.errorCode == SignetsError.gradesEmpty ||
322+
e.message.startsWith(SignetsError.gradesNotAvailable)) {
322323
_logger.e(
323324
"$tag - getCourseSummary: Summary is empty for ${course.acronym}.");
324325
return null;

lib/ui/utils/app_theme.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class AppTheme {
3737
return lightTheme.copyWith(
3838
primaryColor: etsLightRed,
3939
accentColor: etsLightRed,
40-
colorScheme: lightTheme.colorScheme.copyWith(primary: etsLightRed),
40+
colorScheme: lightTheme.colorScheme
41+
.copyWith(primary: etsLightRed, secondary: etsLightRed),
4142
bottomNavigationBarTheme: lightTheme.bottomNavigationBarTheme
4243
.copyWith(selectedItemColor: etsLightRed));
4344
}
@@ -51,7 +52,8 @@ class AppTheme {
5152
scaffoldBackgroundColor: const Color(0xff121212),
5253
cardColor: const Color(0xff1e1e1e),
5354
accentColor: etsLightRed,
54-
colorScheme: darkTheme.colorScheme.copyWith(primary: etsLightRed),
55+
colorScheme: darkTheme.colorScheme
56+
.copyWith(primary: etsLightRed, secondary: etsLightRed),
5557
bottomNavigationBarTheme: darkTheme.bottomNavigationBarTheme
5658
.copyWith(selectedItemColor: etsLightRed));
5759
}

lib/ui/views/dashboard_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class _DashboardViewState extends State<DashboardView>
8383
child: ReorderableListView(
8484
onReorder: (oldIndex, newIndex) =>
8585
onReorder(model, oldIndex, newIndex),
86-
padding: const EdgeInsets.fromLTRB(8, 4, 8, 8),
86+
padding: const EdgeInsets.fromLTRB(0, 4, 0, 8),
8787
children: _buildCards(model),
8888
),
8989
));

lib/ui/widgets/dismissible_card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DismissibleCard extends StatelessWidget {
2828
child: Card(
2929
elevation: elevation,
3030
color: cardColor,
31-
margin: const EdgeInsets.fromLTRB(0, 4, 0, 4),
31+
margin: const EdgeInsets.fromLTRB(8, 4, 8, 4),
3232
child: Stack(children: [
3333
child,
3434
if (isBusy)

lib/ui/widgets/grade_circular_progress.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class _GradeCircularProgressState extends State<GradeCircularProgress>
9191
);
9292
}
9393

94-
double getGradeInDecimals(double grade) => grade / 100;
94+
double getGradeInDecimals(double grade) =>
95+
(grade / 100) > 1.0 ? 1.0 : (grade / 100);
9596

9697
String getGrade(BuildContext context) {
9798
if (widget.finalGrade != null) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1515
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 4.1.0+1
18+
version: 4.1.1+1
1919

2020
environment:
2121
sdk: ">=2.10.0 <3.0.0"

test/ui/widgets/dismissible_card_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,15 @@ void main() {
1818

1919
expect(find.text(cardText), findsOneWidget);
2020
});
21+
testWidgets("isBusy", (WidgetTester tester) async {
22+
await tester.pumpWidget(localizedWidget(
23+
child: DismissibleCard(
24+
isBusy: true,
25+
onDismissed: (DismissDirection direction) {},
26+
child: const Text(cardText))));
27+
28+
expect(find.text(cardText), findsOneWidget);
29+
expect(find.byType(CircularProgressIndicator), findsOneWidget);
30+
});
2131
});
2232
}

0 commit comments

Comments
 (0)