26-1-20/1
This commit is contained in:
@@ -186,6 +186,52 @@ class RegistrationView extends StatelessWidget {
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
// ============================================================
|
||||
// 1. القائمة المنسدلة لتصنيف المركبة (سيارة، دراجة، فان)
|
||||
// ============================================================
|
||||
DropdownButtonFormField<int>(
|
||||
value: c.selectedVehicleCategoryId,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Vehicle Category'.tr, // ترجمة: تصنيف المركبة
|
||||
border: const OutlineInputBorder(),
|
||||
prefixIcon: const Icon(Icons.directions_car),
|
||||
),
|
||||
items: c.vehicleCategoryOptions.map((item) {
|
||||
return DropdownMenuItem<int>(
|
||||
value: item['id'],
|
||||
child: Text(item['name']),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (val) {
|
||||
c.selectedVehicleCategoryId = val;
|
||||
c.update(); // تحديث الواجهة إذا لزم الأمر
|
||||
},
|
||||
validator: (v) => (v == null) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// ============================================================
|
||||
// 2. القائمة المنسدلة لنوع الوقود (بنزين، كهرباء...)
|
||||
// ============================================================
|
||||
DropdownButtonFormField<int>(
|
||||
value: c.selectedFuelTypeId,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Fuel Type'.tr, // ترجمة: نوع الوقود
|
||||
border: const OutlineInputBorder(),
|
||||
prefixIcon: const Icon(Icons.local_gas_station),
|
||||
),
|
||||
items: c.fuelTypeOptions.map((item) {
|
||||
return DropdownMenuItem<int>(
|
||||
value: item['id'],
|
||||
child: Text(item['name']),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (val) {
|
||||
c.selectedFuelTypeId = val;
|
||||
c.update();
|
||||
},
|
||||
validator: (v) => (v == null) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.carPlateController,
|
||||
decoration: InputDecoration(
|
||||
|
||||
Reference in New Issue
Block a user