I`m new in flutter (dart). I create a class with three fields (frontColor, angle and rearColor), also based on this class I created six objects with parameters (here I insert only two of them). I need a widget that will randomly select one of the objects and display it using SizedBox in child (here must be our Widget), like:
Center(
child: SizedBox(
height: 142,
width: 141,
child: ...
),
),
Here is my class and objects which I create:
class Circle {
Color frontColor;
ColorFilter rearColor;
double angle;
Circle(
this.frontColor,
this.rearColor,
this.angle,
);
}
Circle firstCircle = Circle(
const Color(0xFF41AB9D),
const ColorFilter.mode(Color(0xFF49C1B0), BlendMode.srcATop),
0.0,
);
Circle fourthCircle = Circle(
const Color(0xFF49C1B0),
const ColorFilter.mode(Color(0xFF41AB9D), BlendMode.srcATop),
360 / 30,
);
In result I should get something like that but the parameters must be transmitted externally:
Widget _circleBackground() {
return Container(
width: 141,
height: 142,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2500.0),
color: const Color(0xFF41AB9D),
image: const DecorationImage(
colorFilter: ColorFilter.mode(Color(0xFF49C1B0), BlendMode.srcATop),
image: AssetImage('...'),
),
),
);}