@@ -10,13 +10,14 @@ class Table extends StatelessWidget {
1010 const Table ({
1111 required this .startHour,
1212 required this .endHour,
13+ this .hoursOffset = 0 ,
1314 this .size,
1415 this .tableDirection = Axis .vertical,
1516 this .hourDimension = 80 ,
1617 this .tableOffset = 20 ,
1718 this .theme = const TableTheme (),
18- Key ? key,
19- }) : super (key : key) ;
19+ super . key,
20+ });
2021
2122 /// The [Axis] in which the table is layed out.
2223 final Axis tableDirection;
@@ -30,6 +31,9 @@ class Table extends StatelessWidget {
3031 /// The hour the table ends at.
3132 final int endHour;
3233
34+ /// The time offset to increase all hour labels with
35+ final int hoursOffset;
36+
3337 /// The length in pixel of a single hour in the table.
3438 final double hourDimension;
3539
@@ -55,7 +59,7 @@ class Table extends StatelessWidget {
5559 Column (
5660 children: [
5761 Text (
58- '${((i == 24 ) ? '00' : i .toString ()).padLeft (2 , '0' )}'
62+ '${((( i + hoursOffset ) == 24 ) ? '00' : (( i + hoursOffset ) % 24 ) .toString ()).padLeft (2 , '0' )}'
5963 ':00' ,
6064 style: theme.timeStyle ??
6165 Theme .of (context).textTheme.bodyLarge,
@@ -124,7 +128,7 @@ class Table extends StatelessWidget {
124128 Row (
125129 children: [
126130 Text (
127- '${i .toString ().padLeft (2 , '0' )}:00' ,
131+ '${(( i + hoursOffset ) % 24 ) .toString ().padLeft (2 , '0' )}:00' ,
128132 style: theme.timeStyle ??
129133 Theme .of (context).textTheme.bodyLarge,
130134 ),
0 commit comments