-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lecturer card in class_view page (#151)
* Add teacher bottom sheet card in event view * Add lecturer info in class_view page * Add lecturer card test * Change class_view title * Bump app version * Add new release changelogs * Apply suggestions from code review Co-authored-by: Ioana Alexandru <[email protected]> Co-authored-by: Ioana Alexandru <[email protected]>
- Loading branch information
1 parent
a0adb21
commit 0337750
Showing
16 changed files
with
241 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Fixed | ||
- Error message shown when cancelling profile picture selection | ||
|
||
Added | ||
- Card containing the class name and its associated lecturer on the class info page | ||
- Ability to click on a lecturer from an event and display more details about them |
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,6 @@ | ||
Fixed | ||
- Error message shown when cancelling profile picture selection | ||
|
||
Added | ||
- Card containing the class name and its associated lecturer on the class info page | ||
- Ability to click on a lecturer from an event and display more details about them |
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,7 @@ | ||
Rezolvat | ||
- Mesaj de eroare afișat la anularea selectării imaginii de profil | ||
|
||
Adăugat | ||
- Card care conține numele materiei și cadrul didactic titular pe pagina de informații a unei materii | ||
- Posibilitatea de a apăsa pe un profesor asociat unui eveniment și de a afișa mai multe | ||
detalii despre acesta |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,59 @@ | ||
import 'package:acs_upb_mobile/pages/classes/model/class.dart'; | ||
import 'package:auto_size_text/auto_size_text.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:black_hole_flutter/black_hole_flutter.dart'; | ||
|
||
extension ClassExtension on ClassHeader { | ||
Color get colorFromAcronym { | ||
int r = 0, g = 0, b = 0; | ||
if (acronym.isNotEmpty) { | ||
b = acronym[0].codeUnitAt(0); | ||
if (acronym.length >= 2) { | ||
g = acronym[1].codeUnitAt(0); | ||
if (acronym.length >= 3) { | ||
r = acronym[2].codeUnitAt(0); | ||
} | ||
} | ||
} | ||
const int brightnessFactor = 2; | ||
return Color.fromRGBO( | ||
r * brightnessFactor, g * brightnessFactor, b * brightnessFactor, 1); | ||
} | ||
} | ||
|
||
class ClassIcon extends StatelessWidget { | ||
const ClassIcon({ | ||
@required this.classHeader, | ||
Key key, | ||
this.selected = false, | ||
}) : super(key: key); | ||
|
||
final ClassHeader classHeader; | ||
final bool selected; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CircleAvatar( | ||
backgroundColor: classHeader.colorFromAcronym, | ||
child: Container( | ||
width: 30, | ||
child: selected | ||
? Icon( | ||
Icons.check, | ||
color: classHeader.colorFromAcronym.highEmphasisOnColor, | ||
) | ||
: Align( | ||
alignment: Alignment.center, | ||
child: AutoSizeText( | ||
classHeader.acronym, | ||
minFontSize: 0, | ||
maxLines: 1, | ||
style: TextStyle( | ||
color: classHeader.colorFromAcronym.highEmphasisOnColor, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.