add option to add more than one service

fatima_dev
Fatimah.Alshammari 1 day ago
parent 10b8cf95a2
commit be9c9bceae

@ -0,0 +1,28 @@
import 'package:mc_common_app/models/services_models/item_model.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
class SelectedAppointmentServiceModel {
final DropValue category;
final DropValue service;
final List<ItemData> items;
SelectedAppointmentServiceModel({
required this.category,
required this.service,
required this.items,
});
double get totalPrice => items.fold<double>(
0,
(sum, item) => sum + (double.tryParse(item.price ?? '0') ?? 0),
);
List<int> get itemIds => items
.map((item) => item.id)
.whereType<int>()
.where((id) => id > 0)
.toList();
}

@ -355,12 +355,18 @@ class _SearchableDropdownSheetState extends State<_SearchableDropdownSheet> {
fontWeight: isSelected ? MyFonts.Bold : MyFonts.Medium,
),
trailing: isSelected ? const Icon(Icons.check, color: MyColors.darkPrimaryColor) : null,
// onTap: !isEnabled
// ? null
// : () {
// widget.onSelected(value);
// Navigator.pop(context);
// },
onTap: !isEnabled
? null
: () {
widget.onSelected(value);
Navigator.pop(context);
},
Navigator.pop(context);
widget.onSelected(value);
},
);
},
),

Loading…
Cancel
Save