fix: Fixed the assert to check the values properly

This commit is contained in:
Jacques 2023-11-07 10:39:22 +01:00
parent 77d5e2fb36
commit 3d6a78de65
4 changed files with 8 additions and 2 deletions

View file

@ -18,3 +18,7 @@
## [1.2.0] - 6 November 2023 ## [1.2.0] - 6 November 2023
* Add the ability to use BorderScroll. If enabled the next page is shown when scrolling to an specific offset. * Add the ability to use BorderScroll. If enabled the next page is shown when scrolling to an specific offset.
## [1.2.1] - 7 November 2023
* Fixed the assert on the [scrollTriggerOffset] and [scrollJumpToOffset].

View file

@ -147,6 +147,8 @@ class _TimetableDemoState extends State<TimetableDemo> {
Container( Container(
color: Colors.white, color: Colors.white,
child: Timetable( child: Timetable(
onOverScroll: () {},
onUnderScroll: () {},
size: Size(size.width, size.height * 0.64), size: Size(size.width, size.height * 0.64),
tableDirection: _horizontal ? Axis.horizontal : Axis.vertical, tableDirection: _horizontal ? Axis.horizontal : Axis.vertical,
startHour: 3, startHour: 3,

View file

@ -39,7 +39,7 @@ class Timetable extends StatefulWidget {
this.scrollJumpToOffset = 115, this.scrollJumpToOffset = 115,
super.key, super.key,
}) : assert( }) : assert(
scrollTriggerOffset < scrollJumpToOffset, scrollTriggerOffset > scrollJumpToOffset,
'ScrollTriggerOffset cannot be smaller' 'ScrollTriggerOffset cannot be smaller'
' then the scrollJumpToOffset.'); ' then the scrollJumpToOffset.');

View file

@ -1,6 +1,6 @@
name: flutter_timetable name: flutter_timetable
description: Flutter package to create a Timetable Widget that display blocks of widgets inside a timetable. description: Flutter package to create a Timetable Widget that display blocks of widgets inside a timetable.
version: 1.2.0 version: 1.2.1
repository: https://github.com/Iconica-Development/timetable repository: https://github.com/Iconica-Development/timetable
environment: environment: