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
## [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.
const TableTheme({
this.lineColor = const Color(0x809E9E9E),
this.lineHeight = 2,
this.lineStrokeWidth = 2,
this.tableTextOffset = 5,
this.lineDashDistance = 10,
this.lineDashLength = 10,
@ -23,7 +23,7 @@ class TableTheme {
final Color lineColor;
/// The height of the lines.
final double lineHeight;
final double lineStrokeWidth;
/// The distance between dashes on the line.
final double lineDashDistance;

View file

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

View file

@ -14,14 +14,10 @@ class Table extends StatelessWidget {
this.tableDirection = Axis.vertical,
this.hourDimension = 80,
this.tableOffset = 20,
this.tableHeight = 400,
this.theme = const TableTheme(),
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.
final Axis tableDirection;
@ -67,7 +63,7 @@ class Table extends StatelessWidget {
SizedBox(height: theme.tableTextOffset),
Container(
color: theme.lineColor,
width: theme.lineHeight,
width: theme.lineStrokeWidth,
height: (size ?? MediaQuery.of(context).size).height -
textSize.dy -
theme.tableTextOffset,
@ -79,7 +75,7 @@ class Table extends StatelessWidget {
SizedBox(
width: hourDimension / 2 -
textSize.dx / 2 -
theme.lineHeight,
theme.lineStrokeWidth,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -100,7 +96,7 @@ class Table extends StatelessWidget {
2);
i++) ...[
Container(
width: theme.lineHeight,
width: theme.lineStrokeWidth,
height: i.isEven
? theme.lineDashLength
: theme.lineDashDistance,
@ -137,7 +133,7 @@ class Table extends StatelessWidget {
),
Expanded(
child: Container(
height: theme.lineHeight,
height: theme.lineStrokeWidth,
color: theme.lineColor,
),
)
@ -149,7 +145,7 @@ class Table extends StatelessWidget {
margin: EdgeInsets.only(
left: tableOffset,
),
height: theme.lineHeight,
height: theme.lineStrokeWidth,
child: Row(
children: [
for (int i = 0;
@ -165,7 +161,7 @@ class Table extends StatelessWidget {
width: i.isEven
? theme.lineDashLength
: theme.lineDashDistance,
height: theme.lineHeight,
height: theme.lineStrokeWidth,
color:
i.isEven ? theme.lineColor : Colors.transparent,
),