This this part when I expand my text ui then up side and bottom i am getting line but i dont want this and i also want color light grey when my text is expanding but that things also not working. please help me to solve this
this is my code.
import 'package:cwc/constants/constants.dart';
import 'package:flutter/material.dart';
class ListItem extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return ListItemState();
}
}
class ListItemState extends State<ListItem> {
bool isExpand = false;
@override
void initState() {
// TODO: implement initState
super.initState();
isExpand = false;
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView(
children: [
for (int i = 0; i < 15; i++)
Card(
child: Container(
color: (isExpand == true) ? Color(0xfff6f7f9) : Colors.white,
child: ExpansionTile(
backgroundColor: Colors.white,
title: Container(
width: double.infinity,
child: Text(
"How do I engage employees in a wellness program?",
style: TextStyle(
color: Color(0xFF444444),
fontSize: tSize14,
fontWeight: FontWeight.w500),
)),
trailing: (isExpand == true)
? Icon(
Icons.keyboard_arrow_down,
size: 32,
color: Colors.grey,
)
: Icon(Icons.keyboard_arrow_up,
size: 32, color: Colors.grey),
onExpansionChanged: (value) {
setState(() {
isExpand = value;
});
},
children: [
Container(
width: double.infinity,
padding: EdgeInsets.only(
top: 20, left: 10, right: 10, bottom: 20),
child: Text(
"""Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.""",
style: TextStyle(
color: Color(0xFF444444),
fontSize: 13,
))),
],
),
),
),
],
),
);
}
}
In Actuall I want like this ui
But it is becoming like this (Page first when text not expand)
Page Second when text is expanded--
(Page Second when text is expanded)