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

Second GET API Calling with Bloc simple Example in Flutter

Stack Container Scrollable Card widget UI with Custom Widget

Pagination with Bloc Pattern in Flutter