'Flutter ExpansionTile Extention button placement
I have a container which i want to expand one i click the down arrow button. If you look in this picture (https://gyazo.com/eeaa9fb8d3f93d5f6f190ced2389e2e1), you can see that i already added a button which i want to click so it will expand. But once i wrap the container in an expansiontile, it adds an arrow to the left of it as you can see in this picture (https://gyazo.com/c8ec072e511f7f0d03ff925c2d8f158d).
My code is here with the results in the second picture
Container(
width: MediaQuery.of(context).size.width * 0.97,
margin: EdgeInsets.only(top: 10, bottom: 10),
padding: EdgeInsets.only(top: 10, left: 20, right: 20),
decoration: BoxDecoration(
color: Color(0xff0A213D),
borderRadius:
BorderRadius.vertical(bottom: Radius.circular(3))),
child: ExpansionTile(
title: Column(children: < Widget > [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: < Widget > [
Container(
margin: EdgeInsets.only(top: 15),
child:
Text("Obiectiv numarul 1", style: TextStyle(fontSize: 22, color: Colors.white), ), ),
IconButton(
iconSize: 35,
color: Color(0xff6c7a8b),
icon: Icon(Icons.create_outlined),
onPressed: () {
},
),
], ),
Align(
alignment: Alignment.centerRight,
child: Text('5 dec 2020', style: TextStyle(fontSize: 15, color: Color(0xffdadada)), )),
Container(
margin: EdgeInsets.only(top: 10, bottom: 10),
color: Colors.white,
child: StepProgressIndicator(
totalSteps: 5,
currentStep: 2,
size: 6,
selectedColor: Color(0xff2f80ed),
unselectedColor: Colors.grey,
)
),
Align(
alignment: Alignment.centerRight,
child: IconButton(
iconSize: 45,
color: Color(0xff2f80ed),
icon: Icon(Icons.keyboard_arrow_down_outlined),
onPressed: () {
},
)),
], ),
children: < Widget > [
Text('expanded text')
],
)
)
Solution 1:[1]
Settings trailing parameter to Container()
or SizedBox()
would remove the 2nd arrow or you could set your IconButton()
to be the trailing: of ExpansionTile
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ravindra S. Patil |