creating a table using rows and column widget in flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('My application')),
body:Center(
child: Container(
height: 300,
width: 300,
color: Colors.amberAccent,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('Azhar', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Waris', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Mahfuz', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('Minhaj', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Chotu', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Mansur', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('Sahnawaj', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Shane ', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
Text('Hasmi', style: TextStyle(fontSize: 25,fontWeight: FontWeight.w800, color: Colors.blue),),
],
)
],
),
),
)
);
}
}
Comments
Post a Comment