import 'package:flutter/material.dart'; class TableHeaderCustom extends StatelessWidget { final String title1, title2, title3, title4, title5; const TableHeaderCustom({ Key? key, required this.title1, required this.title2, required this.title3, required this.title4, required this.title5, }) : super(key: key); @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, constraint) { double widthCell = constraint.maxWidth * 0.2; return Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ SizedBox( width: widthCell, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( title1, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.w600), ), ), ), SizedBox( width: widthCell, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( title2, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.w600), ), ), ), SizedBox( width: widthCell, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( title3, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.w600), ), ), ), SizedBox( width: widthCell, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( title4, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.w600), ), ), ), SizedBox( width: widthCell, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( title5, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.w600), ), ), ), ], ); }); } }