FutureBuilder(
future: getClaimDetail(""),
builder:
(BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.data != null) {
return Container(
height: 150,
decoration: const BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(15)),
boxShadow: null,
),
padding: const EdgeInsets.all(20),
child: Column(
children: [
Row(
children: [
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Text(
'Claim ID',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Color(AppColors.greyText),
),
),
),
),
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Text(
'Contract No.',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Color(AppColors.greyText),
),
),
),
),
],
),
Row(
children: [
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Text(
widget.claimNumber,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
),
const Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Text(
'KP2207514735',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
),
],
),
Divider(
color: Color(AppColors.bgColor),
height: 20,
thickness: 1,
),
Flexible(
//fit: FlexFit.tight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Align(
alignment: Alignment.centerLeft,
child: Container(
height: 59,
width: 59,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10)),
image: DecorationImage(
image: AssetImage(
"lib/Assets/Images/car.png"),
fit: BoxFit.cover,
)),
),
),
Flexible(
fit: FlexFit.tight,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Row(
children: [
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Padding(
padding:
const EdgeInsets.only(
left: 10,
bottom: 5),
child: Text(
snapshot.data.make +
" " +
snapshot.data.model,
style: const TextStyle(
fontSize: 16,
fontWeight:
FontWeight.w700,
),
),
),
),
),
Flexible(
child: Expanded(
child: Align(
alignment:
Alignment.centerRight,
child: Container(
margin:
const EdgeInsets.only(
bottom: 5),
decoration: BoxDecoration(
color: Color(AppColors
.bgColor),
borderRadius:
const BorderRadius
.all(
Radius
.circular(
5))),
padding:
const EdgeInsets.all(
3),
child: Text(
snapshot.data.year,
style: TextStyle(
color: Color(AppColors
.primaryBlueColor),
fontSize: 10,
fontWeight:
FontWeight
.w500),
),
),
)),
),
],
),
Row(
children: [
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Padding(
padding:
const EdgeInsets.only(
left: 10, top: 5),
child: Text.rich(TextSpan(
text: 'Model: ',
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight
.w500,
color: Color(
AppColors
.greyText)),
children: <
InlineSpan>[
TextSpan(
text: snapshot
.data.model
.toString(),
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight
.w700,
color: Color(
AppColors
.blackText)),
),
])),
),
),
),
Flexible(
child: FractionallySizedBox(
widthFactor: 1,
child: Padding(
padding:
const EdgeInsets.only(
top: 5),
child: Text.rich(TextSpan(
text: 'Make: ',
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight
.w500,
color: Color(
AppColors
.greyText)),
children: <
InlineSpan>[
TextSpan(
text: snapshot
.data.make
.toString(),
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight
.w700,
color: Color(
AppColors
.blackText)),
)
])),
),
),
),
],
),
],
),
)
],
)),
],
),
);
} else {
return const Center(child: Text(''));
}
}),
设计这张卡片最好的方法是什么?我对行和列进行了操作,但当键盘出现时,当我点击此功能构建器下方的文本字段时,会导致像素溢出等问题.汽车图像后的弹性排导致溢出,我不知道为什么!它已经在灵活的窗口小部件中了.如果我不点击Textfield,它就可以正常工作.请给我带路.FutureBuilder构建器位于主列中,该列也包装在一个容器中,而该容器位于SingleChiledScrollView中.
它给出了这些错误
════════ Exception caught by rendering library ═════════════════════════════════
A RenderFlex overflowed by 25 pixels on the bottom.
The relevant error-causing widget was
Column
=> (its the flexible column inside the row with flexfit.tight)
Exception has occurred.
_AssertionError ('package:flutter/src/widgets/framework.dart': Failed assertion: line 5186 pos 16: 'child is! ParentDataElement<ParentData>': is not true.)