42 lines
1.9 KiB
Python
42 lines
1.9 KiB
Python
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)
|