-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<img width="776" alt="image" src="https://github.com/SharezoneApp/sharezone-app/assets/24459435/74e15459-2c71-4744-a38a-ea6f0c437aab"> Part of #1312
- Loading branch information
1 parent
fd1cd81
commit 9ad3843
Showing
49 changed files
with
853 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2024 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
import 'package:design/design.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class SubjectAvatar extends StatelessWidget { | ||
const SubjectAvatar({ | ||
super.key, | ||
required this.design, | ||
required this.abbreviation, | ||
}); | ||
|
||
final String abbreviation; | ||
final Design design; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CircleAvatar( | ||
backgroundColor: design.color.withOpacity(0.2), | ||
child: Text( | ||
abbreviation, | ||
style: TextStyle(color: design.color), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Copyright (c) 2024 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:sharezone/grades/pages/grades_view.dart'; | ||
|
||
class TermTile extends StatelessWidget { | ||
const TermTile({ | ||
super.key, | ||
required this.displayName, | ||
required this.avgGrade, | ||
required this.title, | ||
}); | ||
|
||
final String title; | ||
final DisplayName displayName; | ||
final AvgGradeView avgGrade; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.all(12), | ||
child: Row( | ||
children: [ | ||
Expanded( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
title, | ||
style: const TextStyle( | ||
color: Colors.grey, | ||
), | ||
), | ||
Text( | ||
displayName, | ||
style: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w500, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
const SizedBox(width: 6), | ||
_TermGrade(grade: avgGrade) | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _TermGrade extends StatelessWidget { | ||
const _TermGrade({required this.grade}); | ||
|
||
final AvgGradeView grade; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(8), | ||
color: grade.$2.toColor().withOpacity(0.1), | ||
), | ||
child: Text( | ||
'⌀ ${grade.$1}', | ||
style: TextStyle( | ||
color: grade.$2.toColor(), | ||
fontWeight: FontWeight.w500, | ||
fontSize: 18, | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.