Creating a circle avatar 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) {
var arrNames =['Cashify','Abhinav','Aftab','Sahim','Ankit','Sohail','Shivam','Vikash','Altaf'];
return Scaffold(
appBar: AppBar(title: Text('Profile')),
body:SingleChildScrollView(
child: Center(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.red,
child: Text('Minhaj', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25,

),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
child: Text('Waris', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.grey,
child: Text('Azhar', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.green,
child: Text('Shane', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.black12,
child: Text('Khalid', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.pink,
child: Text('Naushad', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.orange,
child: Text('Sahnawz', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 24
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.yellow,
child: Text('Hasmi', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.purple,
child: Text('Arshad', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CircleAvatar(
backgroundColor: Colors.greenAccent,
child: Text('Dilshad', style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25
),),
radius: 50,
),
)

],
),
),
)



);
}
}

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

Learning stage | c++ programs

c++ basic question