【发布时间】:2022-09-29 18:21:10
【问题描述】:
我尝试对这个扩展面板进行编码,但我什至无法调整它的高度,我尝试了很多方法。我是第一次使用这个小部件,请帮帮我。 谢谢 :) 这就是我想要的
这是我尝试过的代码。在这段代码中,我不能改变高度并面临其他问题。请检查一下。
taskTileTest(List<Task> taskLIst, index, context) {
return Padding(
padding: const EdgeInsets.only(right: 30, left: 30, bottom: 20),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
border: Border.all(width: 0.4),
boxShadow: const [
BoxShadow(
color: Colors.black,
offset: Offset(0.0, 0.0),
blurRadius: 16.0,
spreadRadius: -13,
), //BoxShadow
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(15),
child: ExpansionPanelList.radio(
children: taskLIst
.map((task) => ExpansionPanelRadio(
value: task,
headerBuilder: (ctx, isOpen) => Row(
children: [
Checkbox(
shape: const RoundedRectangleBorder(
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
splashRadius: 10,
checkColor: Colors.white,
fillColor: MaterialStateProperty.all<Color>(
Constants.appThemeColor,
),
value: task.isDone,
onChanged: task.isDeleted == false
? (bool? value) {
context
.read<TaskBloc>()
.add(UpdateTask(task: task));
}
: null,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 200,
child: Text.rich(
const TextSpan(text: \'Task 1\'),
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: \'Helvatica_lite\',
decoration: task.isDone == true
? TextDecoration.lineThrough
: TextDecoration.none,
fontWeight: FontWeight.bold,
fontSize: 15,
color: Colors.black,
),
)),
const SizedBox(height: 4),
const Text(\'Monday | 10:17 pm\',
// \'${todo.day} | ${todo.time}\',
style: TextStyle(
fontSize: 13,
fontFamily: \'Helvatica_lite\',
color: Colors.grey))
],
)
],
),
body: Text(\'ddd\'),
))
.toList()),
),
),
);
}
-
你想要以上类型的扩展小部件吗?
-
试试我下面的答案
标签: flutter dart flutter-layout