新增數量拉桿、文字說明、數量顯示、選擇文件框
class-AddToLogFormState extends State<AddToLogForm> {
@override
Widget build(BuildContext context) {
final textTheme = AdaptiveTextTheme. of (context);
return Stack(
children: ‹Widget>[
ListView(
padding: MediaQuery.of(context).padding +
EdgeInsets. fromLTRB (24, 16, 24, 16),
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FlatCard(
child: ZoomClipAssetimage(
height: 112,
width: 112,
Zoom: 2.4,
imageAsset: widget.veggie.imageAssetPath,
), // SizedBox
),// FlatCard
SizedBox(width: 12),
Expanded(
child; Column(
crossAxisAlignment; CrossAxisAlignment.start,
children: [],
Text(
widget.veggie.name,
style: textTheme.tileTitle,
),
SizedBox(height: 2),
Text(
widget.veggie.categoryName,
style: textTheme.label,
),// Text
].
),// Column
),// Expanded
},
). // Row
SizedBox(height: 8),
Line(),
CupertinoSegmentedControl(
children: {
0: Text('Breakfast'),
1: Text ('Lunch'),
2: Text ('Dinner'),
},
groupValue: _mealType,
onValueChanged: (type) => setState(() => _mealType = type),
), // CupertinoSegmentedControl
SizedBox (height: 32),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <widget>[
SizedBox(
width: 100,
child: CupertinoTextField(
controller: _servingsTextController,
focusNode: _servingsfocusNode,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
maxLength: 1,
onChanged: (number) {
if (number,isNotEmpty) {
setStatel_servingsFocusNode.unfocus):
]
},
style: TextStyle(
fontSize:34,
fontweight: Fontweight.bold,
),
),
),
SizedBox (width: 24),
Column (
crossAxisAlignment: CrossAxisAlignment.start.
children:
Text (
'Servings of',
style: textTheme, label,
).
SizedBox(height: 4),
Text(
widget, veggie, servingsize,
style: textTheme.body,
),
},
),
},
),
SizedBox (height: 8),
Row(
children: (
Padding(
padding: EdgeInsets.all(12),
child: Text('1', style: textTheme.bodySmall),
), // Padding Padding(
Expanded(
child; CupertinosSlider(
value: nuberOfServings.toDouble(),
min: 1,
max: 10,
divisions: 9,
onChanged: (value) {
setState(() => _servingsTextController.text =
value.floor().toString());
},
),
),
Padding(
padding: EdgeInsets.all(12),
child: Text('10', style: textheme. bodysmall),
), // Padding
],
),// Row
SizedBox(height: 8),
line(),
QuoteText(text: widget.vegggie.shortDescription),
},
),
},
);
}
}