增加 加氢站可用标记
This commit is contained in:
@@ -432,6 +432,7 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
.map(
|
||||
(station) => DropdownMenuItem<String>(
|
||||
value: station.hydrogenId, // value 是站点的唯一ID
|
||||
enabled: station.isSelect == 1,
|
||||
child: _buildDropdownItem(station), // child 是自定义的 Widget
|
||||
),
|
||||
)
|
||||
@@ -478,7 +479,10 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
|
||||
/// 构建下拉菜单中的每一项
|
||||
Widget _buildDropdownItem(StationModel station) {
|
||||
bool isMaintenance = (station.siteStatusName != '营运中');
|
||||
bool isSelectable = (station.isSelect == 1);
|
||||
//营运并且可用
|
||||
bool isMaintenance = ((station.siteStatusName != '营运中') && isSelectable);
|
||||
final textColor = isSelectable ? Colors.black : Colors.grey;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
@@ -495,14 +499,22 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
Flexible(
|
||||
child: Text(
|
||||
station.name,
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
' | ¥${station.price}/kg',
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
if (isMaintenance) const SizedBox(width: 8),
|
||||
if (isMaintenance)
|
||||
|
||||
Reference in New Issue
Block a user