Project management related changes
This commit is contained in:
33
scratch/patch_project_sheet.py
Normal file
33
scratch/patch_project_sheet.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import re
|
||||
|
||||
with open('kifi-app/lib/features/projects/presentation/widgets/add_project_sheet.dart', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace SmartSearchDropdown with DropdownButtonFormField
|
||||
dropdown = """ DropdownButtonFormField<int>(
|
||||
value: _selectedCustomerId,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Client (Optional)',
|
||||
prefixIcon: const Icon(LucideIcons.users),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
),
|
||||
items: [
|
||||
const DropdownMenuItem<int>(value: null, child: Text('None')),
|
||||
...customersState.value!.map((c) => DropdownMenuItem<int>(
|
||||
value: c.id,
|
||||
child: Text(c.name),
|
||||
)),
|
||||
],
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
_selectedCustomerId = val;
|
||||
});
|
||||
},
|
||||
),"""
|
||||
|
||||
content = re.sub(r' SmartSearchDropdown<Customer>\([\s\S]*?\),', dropdown, content)
|
||||
content = content.replace("import '../../../core/widgets/smart_search_dropdown.dart';", "")
|
||||
|
||||
with open('kifi-app/lib/features/projects/presentation/widgets/add_project_sheet.dart', 'w') as f:
|
||||
f.write(content)
|
||||
Reference in New Issue
Block a user