Code:
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
height: 100,
width: 160,
color: Colors.green,
alignment: Alignment.center,
child: Stack(
children: [
Positioned(
left: 60,
child: Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(60),
border: Border.all(
color: Colors.white,
width: 3,
),
),
width: 100,
height: 100,
),
),
Positioned(
left: 0,
child: Container(
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(50),
border: Border.all(
color: Colors.white,
width: 3,
),
),
width: 100,
height: 100,
),
),
],
),
),
),
);
}
}
CodePudding user response:
You can use this way also: CircleAvatar Widget
CircleAvatar(
radius: 20,
backgroundImage: NetworkImage('{image url}')
)

