How to make a container is stack over the image like this picture Figma Design
i made the code and its fail
`` Stack( children: [ Positioned( left : MediaQuery.of(context).size.width * 0.2, right :0, top : 0, bottom : MediaQuery.of(context).size.width * 0.03, child : Container(
height: MediaQuery.of(context).size.width * 0.3,
width: MediaQuery.of(context).size.width * 0.3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
image: DecorationImage(
image: AssetImage('images/dashboard.png'),
fit: BoxFit.cover,
),
shape: BoxShape.rectangle,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.15,
width: MediaQuery.of(context).size.width * 0.3,
margin: EdgeInsets.only(top: 30, bottom: 50),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromARGB(255, 0, 99, 180),
blurRadius: 30,
),
],
color: Color.fromARGB(255, 253, 253, 253),
border: Border.all(color: Color(0xff475BD8)),
borderRadius: BorderRadius.circular(16),
),
child: GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return dashboard2();
},
),
);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"Dashboard",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: calculateFontSize(context,17),
fontWeight: FontWeight.w500,
fontFamily: 'David Libre',
color: Colors.black,
),
),
],
),
),
),
], ),
``
the result of that code is not like the figma design flutter result
code fix, so the container can stack over the image like in the figma design
To achieve the Figma design, you can follow the steps below:
Here is the example -
Output -
You can edit the stack top-level and children containers width and height as per your design.