forked from firka/student-legacy
new grades fix thingie
This commit is contained in:
parent
8bbeb11b59
commit
da62b1bfa9
@ -22,7 +22,7 @@ class NewGradesSurprise extends StatelessWidget {
|
|||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 4.0),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
@ -42,11 +42,13 @@ class NewGradesSurprise extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(boxShadow: [
|
decoration: BoxDecoration(boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.5),
|
color:
|
||||||
|
Theme.of(context).colorScheme.secondary.withOpacity(.5),
|
||||||
blurRadius: 18.0,
|
blurRadius: 18.0,
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
child: const RiveAnimation.asset("assets/animations/backpack-2.riv"),
|
child: const RiveAnimation.asset(
|
||||||
|
"assets/animations/backpack-2.riv"),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -64,9 +66,7 @@ class NewGradesSurprise extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Text(
|
: Text(
|
||||||
grades.length == 1 ?
|
grades.length == 1 ? "new_grade".i18n : "new_grades".i18n,
|
||||||
"new_grade".i18n :
|
|
||||||
"new_grades".i18n,
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
@ -141,7 +141,9 @@ class NewGradesSurprise extends StatelessWidget {
|
|||||||
|
|
||||||
final gradeProvider = Provider.of<GradeProvider>(context, listen: false);
|
final gradeProvider = Provider.of<GradeProvider>(context, listen: false);
|
||||||
|
|
||||||
final newGrades = gradeProvider.grades.where((element) => element.date.isAfter(gradeProvider.lastSeenDate)).toList();
|
final newGrades = gradeProvider.grades
|
||||||
|
.where((element) => element.date.isAfter(gradeProvider.lastSeenDate))
|
||||||
|
.toList();
|
||||||
newGrades.sort((a, b) => a.date.compareTo(b.date));
|
newGrades.sort((a, b) => a.date.compareTo(b.date));
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
await Future.delayed(const Duration(milliseconds: 100));
|
await Future.delayed(const Duration(milliseconds: 100));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user