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) {
|
Widget filterViewBuilder(context, int activeData) {
|
||||||
List<Widget> filterWidgets = [];
|
List<Widget> filterWidgets = [];
|
||||||
|
|
||||||
|
var absWidgets = getFilterWidgets(AbsenceFilter.values[activeData])
|
||||||
|
.map((e) => e.widget)
|
||||||
|
.cast<Widget>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
if (activeData > 0) {
|
if (activeData > 0) {
|
||||||
filterWidgets = sortDateWidgets(
|
filterWidgets = sortDateWidgets(
|
||||||
context,
|
context,
|
||||||
@ -265,7 +270,7 @@ class AbsencesPageState extends State<AbsencesPage>
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
hasShadow: true,
|
hasShadow: true,
|
||||||
);
|
);
|
||||||
} else {
|
} else if (absWidgets.isNotEmpty) {
|
||||||
filterWidgets = [
|
filterWidgets = [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 24.0),
|
padding: const EdgeInsets.only(bottom: 24.0),
|
||||||
@ -317,10 +322,7 @@ class AbsencesPageState extends State<AbsencesPage>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: getFilterWidgets(AbsenceFilter.values[activeData])
|
children: absWidgets,
|
||||||
.map((e) => e.widget)
|
|
||||||
.cast<Widget>()
|
|
||||||
.toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -5,6 +5,7 @@ import 'dart:math';
|
|||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:filcnaplo/api/providers/update_provider.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/ui/widgets/grade/grade_tile.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/exam.dart';
|
import 'package:filcnaplo_kreta_api/models/exam.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
||||||
@ -140,6 +141,15 @@ class GradesPageState extends State<GradesPage> {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
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(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: const Radius.circular(16.0),
|
topLeft: const Radius.circular(16.0),
|
||||||
topRight: const Radius.circular(16.0),
|
topRight: const Radius.circular(16.0),
|
||||||
@ -174,6 +184,15 @@ class GradesPageState extends State<GradesPage> {
|
|||||||
if (hasHomework)
|
if (hasHomework)
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
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(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: const Radius.circular(8.0),
|
topLeft: const Radius.circular(8.0),
|
||||||
topRight: const Radius.circular(8.0),
|
topRight: const Radius.circular(8.0),
|
||||||
@ -213,6 +232,15 @@ class GradesPageState extends State<GradesPage> {
|
|||||||
if (nearestExam != null)
|
if (nearestExam != null)
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
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(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(8.0),
|
topLeft: Radius.circular(8.0),
|
||||||
topRight: Radius.circular(8.0),
|
topRight: Radius.circular(8.0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user