import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( // Application name title: 'Flutter Hello World', // Application theme data, you can set the colors for the application as // you want theme: ThemeData( primarySwatch: Colors.blue, ), // A widget which will be started on application startup home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatelessWidget { final String title; const MyHomePage({@required this.title}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( // The title text which will be shown on the action bar title: Text(title), ), body: Container( child: DataTable( columns: [ DataColumn(label: Text('ID'), tooltip: 'Book identifier'), DataColumn(label: Text('Book')), DataColumn(label: Text('Author')) ], rows: [ DataRow(cells: [ DataCell(Text('#100')), DataCell( Text( 'Flutter Basics', style: TextStyle(fontWeight: FontWeight.bold), ), ), DataCell(Text('David John')), ]), DataRow(cells: [ DataCell(Text('#101')), DataCell(Text('Dart Internals')), DataCell(Text('Alex Wick')), ]) ], showBottomBorder: true, headingTextStyle: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey), ), ), ); } }
Add to favorites