From b9e9bef18297baa93e80c3bba58f68d33d81a264 Mon Sep 17 00:00:00 2001 From: balint1414 Date: Tue, 3 Sep 2024 18:49:55 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fektetett=20=C3=B3rarend=20hib=C3=A1s=20ki?= =?UTF-8?q?=C3=ADr=C3=A1s=20jav=C3=ADt=C3=A1sa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/pages/timetable/fs_timetable.dart | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart b/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart index 64e3be0..59ed18c 100644 --- a/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart +++ b/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart @@ -78,7 +78,7 @@ class _FSTimetableState extends State { itemCount: maxLessonCount + 1, itemBuilder: (context, index) { List columns = []; - for (int dayIndex = -1; dayIndex < days.length; dayIndex++) { + for (int dayIndex = -1; dayIndex < days.length; dayIndex++) { if (dayIndex == -1) { if (index >= 1) { columns.add(SizedBox( @@ -87,7 +87,7 @@ class _FSTimetableState extends State { child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Text( - "${index - 1}.", + "${index - 0}.", textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.bold, @@ -119,9 +119,6 @@ class _FSTimetableState extends State { if (lessons.isEmpty) continue; - int lsnIndx = int.tryParse(lessons.first.lessonIndex) ?? 1; - final dayOffset = lsnIndx == 0 ? 1 : lsnIndx; - if (index == 0 && dayIndex >= 0) { columns.add( SizedBox( @@ -141,16 +138,10 @@ class _FSTimetableState extends State { continue; } - final lessonIndex = index - dayOffset; - Lesson? lsn = lessons.firstWhereOrNull( - (e) => e.lessonIndex == (index - 1).toString()); + (e) => e.lessonIndex == index.toString()); - if (lessonIndex < 0 || - lessonIndex > lessons.length || - (index == 1 && lsnIndx != 0) || - (lsnIndx != 0 && lessonIndex - 1 == -1) || - lsn == null) { + if (lsn == null) { columns.add(SizedBox(width: colw)); continue; } From cf0dc50df5d52a27f8ac802be345a40c3c31c712 Mon Sep 17 00:00:00 2001 From: balint1414 Date: Fri, 15 Nov 2024 20:43:18 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fektetett=20=C3=B3rarend:=200.=20=C3=B3ra?= =?UTF-8?q?=20=C3=A9s=20utols=C3=B3=20=C3=B3ra=20megjelen=C3=ADt=C3=A9se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/pages/timetable/fs_timetable.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart b/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart index 59ed18c..ad2f61a 100644 --- a/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart +++ b/refilc_mobile_ui/lib/pages/timetable/fs_timetable.dart @@ -75,10 +75,10 @@ class _FSTimetableState extends State { body: ListView.builder( physics: const BouncingScrollPhysics(), padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 24.0), - itemCount: maxLessonCount + 1, + itemCount: maxLessonCount + 2, itemBuilder: (context, index) { List columns = []; - for (int dayIndex = -1; dayIndex < days.length; dayIndex++) { + for (int dayIndex = -1; dayIndex < days.length; dayIndex++) { if (dayIndex == -1) { if (index >= 1) { columns.add(SizedBox( @@ -87,7 +87,7 @@ class _FSTimetableState extends State { child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Text( - "${index - 0}.", + "${index - 1}.", textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.bold, @@ -120,6 +120,7 @@ class _FSTimetableState extends State { if (lessons.isEmpty) continue; if (index == 0 && dayIndex >= 0) { + // if (index == 0 || dayIndex >=0) { columns.add( SizedBox( width: colw, @@ -139,7 +140,7 @@ class _FSTimetableState extends State { } Lesson? lsn = lessons.firstWhereOrNull( - (e) => e.lessonIndex == index.toString()); + (e) => e.lessonIndex == (index - 1).toString()); if (lsn == null) { columns.add(SizedBox(width: colw)); @@ -250,4 +251,4 @@ class _FSTimetableState extends State { ), ); } -} +} \ No newline at end of file