body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topRight,
colors: [
Colors.orange,
Colors.red,
],
),
),
child: const CircleAvatar(
radius: 70,
backgroundColor: Colors.transparent,
child: Text(
"S",
style: TextStyle(
color: Colors.white,
fontSize: 25.0,
),
),
),
)
],
),
I want the profile color created for each user to be produced only once and remain constant.
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topRight,
colors: [
Colors.orange,
Colors.red,
],
),
),
child: const CircleAvatar(
radius: 70,
backgroundColor: Colors.transparent,
child: Text(
"S",
style: TextStyle(
color: Colors.white,
fontSize: 25.0,
),
),
),
)
],
),
2
Answers
This will generate linear gradient which will be unique for each initial
Simply Try this: