i am new to flutter and i am looking for days to find a way to design with flutter a table score of clubs in a soccer league , and i also was searching for other designs or anything that can help me to do it easy but i almost did not find anything, i am searching for something like this ( just design)
I really have no idea even even how to do anything similar or close to it, any help will be so appreciated.
Update : here what i did but the table do not scroll to the last index
import 'package:flutter/material.dart';
class LeagueBoard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("TableBoard"),
),
body: SingleChildScrollView(
child: Column(
children: [
TopRow(),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 20,
itemBuilder: (context, index) {
return TableRow(index: index);
},
),
],
),
),
);
}
}
class TopRow extends StatelessWidget {
const TopRow({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
Container(
alignment: Alignment.center,
width: 30,
height: 30,
child: Text('#'),
),
SizedBox(width: 20),
Container(alignment: Alignment.center, child: Text('Team')),
Container(
alignment: Alignment.center,
width: 30,
height: 30,
child: Text('#'),
),
SizedBox(width: 20),
Container(
alignment: Alignment.center,
width: 30,
child: Text('MP'),
),
SizedBox(width: 20),
Container(
alignment: Alignment.center,
width: 20,
child: Text('W'),
),
SizedBox(width: 20),
Container(
alignment: Alignment.center,
width: 100,
child: Text('D'),
),
SizedBox(width: 10),
Container(
alignment: Alignment.center,
width: 100,
child: Text('L'),
),
SizedBox(width: 10),
Container(
alignment: Alignment.center,
width: 100,
child: Text('GD'),
),
SizedBox(width: 10),
Container(
alignment: Alignment.center,
width: 50,
child: Text('Pts'),
),
SizedBox(width: 20)
],
);
}
}
class TableRow extends StatelessWidget {
final int index;
const TableRow({
this.index,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 30,
decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 0.5),
color: Colors.grey[300],
),
child: Row(
children: [
Container(
alignment: Alignment.center,
width: 30,
height: 30,
color: index < 4
? Colors.blue
: index == 4
? Colors.red[700]
: index > 16
? Colors.red
: Colors.grey[700],
child: Text(
(index + 1).toString(),
style: TextStyle(color: Colors.white),
),
),
SizedBox(width: 10),
Container(
width:50,
child: Text('Team name#${index + 1}')),
//Spacer(),
Container(
width: 40,
child: Text('MP#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 40,
child: Text('W#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 40,
child: Text('D#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 40,
child: Text('L#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 80,
child: Text('GD#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 50,
child: Text('Pts#${index + 1}'),
),
SizedBox(
width: 10,
),
Container(
width: 5,
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.grey[600],
),
padding: EdgeInsets.fromLTRB(10, 5, 2, 5),
),
],
),
);
}
}


