custom_datatable 0.0.1 custom_datatable: ^0.0.1 copied to clipboard
A Flutter package that allows customization of the datatable by modifying the colors
import 'package:example/widgets/custom_datatable.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
TextStyle headerTextStyle =TextStyle(color:Colors.white,fontSize:20);
return MaterialApp(
title: 'Custom Datatable example',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body:
Center(
child:
CustomDataTable(
headerColor: Colors.green,
rowColor1:Colors.grey.shade300,
dataTable: DataTable(
columns: [DataColumn(label: Text("Name",style: headerTextStyle,),),DataColumn(label: Text("Email",style: headerTextStyle,),),DataColumn(label: Text("Adress",style: headerTextStyle,),),],
rows: [
DataRow(cells: [DataCell(Text("Brandon")),DataCell(Text("brandon@gmail.com")),DataCell(Text("4982 Mutton Town Road"))]),
DataRow(cells: [DataCell(Text("Jane")),DataCell(Text("jane@gmail.com")),DataCell(Text("1800 Fort Street")),]),
DataRow(cells: [DataCell(Text("John"),),DataCell(Text("john@gmail.com"),),DataCell(Text("1308 Berkley Street"),),]),
]
),
)
)
)
);
}
}