class Table extends StatelessWidget {
const Table({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
margin: EdgeInsets.only(left: 2.h, right: 2.h, top: 1.h),
child: TableBoss(
headerHeight: 5.7.h,
rowHeight: 60.h,
headerStyle: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 10.5.sp),
headerColor: Colors.green[200],
rowDataStyle: TextStyle(fontSize: 9.5.sp),
rowColor: Colors.orange[50],
columnSpacing: 1.w,
columns: [
BossDataColumn(child: const Text('No.')),
BossDataColumn(child: const Text('Name')),
BossDataColumn(child: const Text('Type')),
],
rows: examData
.map(
(item) => DataRow(cells: [
DataCell(Text(item.sId.toString())),
DataCell(Text(item.sName)),
DataCell(Text(item.sType)),
]),
)
.toList()),
)
),
);
}
}
|
|