CircleAvatar Widget

 import "package:flutter/material.dart";


void main()
{
runApp(const FlutterApp());
}

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

@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Hello",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.brown,
),
home: const DashBoardScreen(),
);
}
}

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Hello HEER",
style: TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
backgroundColor: Colors.grey,
),

/* Here below -> body: with Container */
/*body: Center(
child: Container(
width: 300,
height: 300,
child: CircleAvatar(
backgroundImage: AssetImage("assets/images/flutter_transparent.JPG"),
backgroundColor: Colors.lightGreen,
),
),
),*/

/* Here below -> body: without Container. Using radius: as shown below */
/*body: Center(
child: CircleAvatar(
child: Text("Name", style: TextStyle(color: Colors.black, fontSize: 60),),
//backgroundImage: AssetImage("assets/images/flutter_transparent.JPG"),
backgroundColor: Colors.brown,
//radius: 200,
//minRadius: 40,
maxRadius: 200,
),
),*/

body: SingleChildScrollView(
child: Center(
child: CircleAvatar(
maxRadius: 200,
child: Container(
width: 150,
height: 150,
child: Column(
children: [
Container(
width: 120,
height: 120,
child: Image.asset("assets/images/flutter_transparent.JPG"),
),
const Text("FLUTTER"),
],
),
),
),
),
),
);
}
}

Comments

Popular posts from this blog

Pagination with Bloc Pattern in Flutter

Pagination First Practical in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter