Table Creation simple

import "package:flutter/material.dart";
import "package:flutter_vishal/app_screen/table_screen.dart";

void main() {
runApp(const HomeScreen());
}
class HomeScreen extends StatelessWidget
{
const HomeScreen({super.key});

@override
Widget build(BuildContext context)
{
return MaterialApp(
debugShowCheckedModeBanner: false,
title: "My App Title",
home: Scaffold(
appBar: AppBar(
title: const Text("My AppBar"),
),
body: const MyTable(),
),
);
}
}

import "package:flutter/material.dart";

class MyTable extends StatelessWidget
{
const MyTable({super.key});

@override
Widget build(BuildContext context)
{
return Material(
child: Container(
margin: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(10.0),
child: Table(
border: TableBorder.all(),
children: const [
TableRow(
children: [
Text("First Name", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold,), textAlign: TextAlign.center,),
Text("Last Name", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold,), textAlign: TextAlign.center,),
],
),
TableRow(
children: [
Text("Vishal", style: TextStyle(fontSize: 20,), textAlign: TextAlign.center,),
Text("Gupta", style: TextStyle(fontSize: 20,), textAlign: TextAlign.center,),
],
),
TableRow(
children: [
Text("Ajay", style: TextStyle(fontSize: 20,), textAlign: TextAlign.center,),
Text("Gupta", style: TextStyle(fontSize: 20,), textAlign: TextAlign.center,),
],
),
],
),
),
);
}
}

Comments

Popular posts from this blog

Pagination with Bloc Pattern in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter

Pagination First Practical in Flutter