fix: remove unused parameters

This commit is contained in:
Freek van de Ven 2022-11-18 15:26:26 +01:00
parent 6aaf5dc171
commit 37337bf9ea
4 changed files with 12 additions and 18 deletions

View file

@ -6,6 +6,7 @@
* Updated TableTheme * Updated TableTheme
## [0.0.3] - 24 Oktober 2022 ## [1.0.0] - 18 November 2022
* Added horizontal variant * Added horizontal variant
* Adjustable size for the component

View file

@ -9,7 +9,7 @@ class TableTheme {
/// and offsets here. /// and offsets here.
const TableTheme({ const TableTheme({
this.lineColor = const Color(0x809E9E9E), this.lineColor = const Color(0x809E9E9E),
this.lineHeight = 2, this.lineStrokeWidth = 2,
this.tableTextOffset = 5, this.tableTextOffset = 5,
this.lineDashDistance = 10, this.lineDashDistance = 10,
this.lineDashLength = 10, this.lineDashLength = 10,
@ -23,7 +23,7 @@ class TableTheme {
final Color lineColor; final Color lineColor;
/// The height of the lines. /// The height of the lines.
final double lineHeight; final double lineStrokeWidth;
/// The distance between dashes on the line. /// The distance between dashes on the line.
final double lineDashDistance; final double lineDashDistance;

View file

@ -121,9 +121,6 @@ class _TimetableState extends State<Timetable> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
children: [ children: [
table.Table( table.Table(
tableHeight: widget.tableDirection == Axis.horizontal
? _calculateTableHeight()
: 0,
tableDirection: widget.tableDirection, tableDirection: widget.tableDirection,
startHour: widget.startHour, startHour: widget.startHour,
endHour: widget.endHour, endHour: widget.endHour,
@ -287,7 +284,7 @@ class _TimetableState extends State<Timetable> {
.size; .size;
} }
double _calculateTableHeight() { double calculateTableHeight() {
var sum = 0.0; var sum = 0.0;
if (widget.mergeBlocks || widget.combineBlocks) { if (widget.mergeBlocks || widget.combineBlocks) {
for (var orderedBlocks in (widget.mergeBlocks) for (var orderedBlocks in (widget.mergeBlocks)

View file

@ -14,14 +14,10 @@ class Table extends StatelessWidget {
this.tableDirection = Axis.vertical, this.tableDirection = Axis.vertical,
this.hourDimension = 80, this.hourDimension = 80,
this.tableOffset = 20, this.tableOffset = 20,
this.tableHeight = 400,
this.theme = const TableTheme(), this.theme = const TableTheme(),
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
//// The height of the table when the tableDirection is horizontal to render the vertical lines
final double tableHeight;
/// The [Axis] in which the table is layed out. /// The [Axis] in which the table is layed out.
final Axis tableDirection; final Axis tableDirection;
@ -67,7 +63,7 @@ class Table extends StatelessWidget {
SizedBox(height: theme.tableTextOffset), SizedBox(height: theme.tableTextOffset),
Container( Container(
color: theme.lineColor, color: theme.lineColor,
width: theme.lineHeight, width: theme.lineStrokeWidth,
height: (size ?? MediaQuery.of(context).size).height - height: (size ?? MediaQuery.of(context).size).height -
textSize.dy - textSize.dy -
theme.tableTextOffset, theme.tableTextOffset,
@ -79,7 +75,7 @@ class Table extends StatelessWidget {
SizedBox( SizedBox(
width: hourDimension / 2 - width: hourDimension / 2 -
textSize.dx / 2 - textSize.dx / 2 -
theme.lineHeight, theme.lineStrokeWidth,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -100,7 +96,7 @@ class Table extends StatelessWidget {
2); 2);
i++) ...[ i++) ...[
Container( Container(
width: theme.lineHeight, width: theme.lineStrokeWidth,
height: i.isEven height: i.isEven
? theme.lineDashLength ? theme.lineDashLength
: theme.lineDashDistance, : theme.lineDashDistance,
@ -137,7 +133,7 @@ class Table extends StatelessWidget {
), ),
Expanded( Expanded(
child: Container( child: Container(
height: theme.lineHeight, height: theme.lineStrokeWidth,
color: theme.lineColor, color: theme.lineColor,
), ),
) )
@ -149,7 +145,7 @@ class Table extends StatelessWidget {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: tableOffset, left: tableOffset,
), ),
height: theme.lineHeight, height: theme.lineStrokeWidth,
child: Row( child: Row(
children: [ children: [
for (int i = 0; for (int i = 0;
@ -165,7 +161,7 @@ class Table extends StatelessWidget {
width: i.isEven width: i.isEven
? theme.lineDashLength ? theme.lineDashLength
: theme.lineDashDistance, : theme.lineDashDistance,
height: theme.lineHeight, height: theme.lineStrokeWidth,
color: color:
i.isEven ? theme.lineColor : Colors.transparent, i.isEven ? theme.lineColor : Colors.transparent,
), ),