Project management related changes
This commit is contained in:
41
scratch/patch_autocomplete.py
Normal file
41
scratch/patch_autocomplete.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import re
|
||||
|
||||
with open('kifi-app/lib/features/projects/presentation/widgets/add_task_sheet.dart', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
old_autocomplete = r""" fieldViewBuilder: \(context, textEditingController, focusNode, onFieldSubmitted\) \{
|
||||
return PremiumTextField\("""
|
||||
|
||||
new_autocomplete = """ optionsViewBuilder: (context, onSelected, options) {
|
||||
return Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Material(
|
||||
elevation: 4,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 200, maxWidth: 300),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: options.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final User option = options.elementAt(index);
|
||||
return ListTile(
|
||||
title: Text(option.name, style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
subtitle: Text(option.email, style: const TextStyle(color: Colors.grey)),
|
||||
onTap: () => onSelected(option),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
fieldViewBuilder: (context, textEditingController, focusNode, onFieldSubmitted) {
|
||||
return PremiumTextField("""
|
||||
|
||||
content = re.sub(old_autocomplete, new_autocomplete, content)
|
||||
|
||||
with open('kifi-app/lib/features/projects/presentation/widgets/add_task_sheet.dart', 'w') as f:
|
||||
f.write(content)
|
||||
Reference in New Issue
Block a user