forked from firka/student-legacy
finally fixed empty absences page
This commit is contained in:
parent
0eabf19d23
commit
450d2bb3fa
@ -258,6 +258,11 @@ class AbsencesPageState extends State<AbsencesPage>
|
||||
Widget filterViewBuilder(context, int activeData) {
|
||||
List<Widget> filterWidgets = [];
|
||||
|
||||
var absWidgets = getFilterWidgets(AbsenceFilter.values[activeData])
|
||||
.map((e) => e.widget)
|
||||
.cast<Widget>()
|
||||
.toList();
|
||||
|
||||
if (activeData > 0) {
|
||||
filterWidgets = sortDateWidgets(
|
||||
context,
|
||||
@ -265,7 +270,7 @@ class AbsencesPageState extends State<AbsencesPage>
|
||||
padding: EdgeInsets.zero,
|
||||
hasShadow: true,
|
||||
);
|
||||
} else {
|
||||
} else if (absWidgets.isNotEmpty) {
|
||||
filterWidgets = [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24.0),
|
||||
@ -317,10 +322,7 @@ class AbsencesPageState extends State<AbsencesPage>
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: getFilterWidgets(AbsenceFilter.values[activeData])
|
||||
.map((e) => e.widget)
|
||||
.cast<Widget>()
|
||||
.toList(),
|
||||
children: absWidgets,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -5,6 +5,7 @@ import 'dart:math';
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:filcnaplo/api/providers/update_provider.dart';
|
||||
import 'package:filcnaplo/models/settings.dart';
|
||||
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
||||
import 'package:filcnaplo_kreta_api/models/exam.dart';
|
||||
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
||||
@ -140,6 +141,15 @@ class GradesPageState extends State<GradesPage> {
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||
.shadowEffect)
|
||||
BoxShadow(
|
||||
offset: const Offset(0, 21),
|
||||
blurRadius: 23.0,
|
||||
color: Theme.of(context).shadowColor,
|
||||
)
|
||||
],
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: const Radius.circular(16.0),
|
||||
topRight: const Radius.circular(16.0),
|
||||
@ -174,6 +184,15 @@ class GradesPageState extends State<GradesPage> {
|
||||
if (hasHomework)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||
.shadowEffect)
|
||||
BoxShadow(
|
||||
offset: const Offset(0, 21),
|
||||
blurRadius: 23.0,
|
||||
color: Theme.of(context).shadowColor,
|
||||
)
|
||||
],
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: const Radius.circular(8.0),
|
||||
topRight: const Radius.circular(8.0),
|
||||
@ -213,6 +232,15 @@ class GradesPageState extends State<GradesPage> {
|
||||
if (nearestExam != null)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||
.shadowEffect)
|
||||
BoxShadow(
|
||||
offset: const Offset(0, 21),
|
||||
blurRadius: 23.0,
|
||||
color: Theme.of(context).shadowColor,
|
||||
)
|
||||
],
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(8.0),
|
||||
topRight: Radius.circular(8.0),
|
||||
|
Loading…
x
Reference in New Issue
Block a user