Skip to content

Commit 0f2dfc6

Browse files
committed
feat(source): add logo url field to create source page
Integrates the `logoUrl` input field into the `CreateSourcePage` UI. This change adds the necessary `TextEditingController` and `TextFormField` to allow users to input a URL for the source's logo. The controller is properly initialized and disposed, and the text field is connected to the `CreateSourceBloc` to handle state updates.
1 parent 01e5a6f commit 0f2dfc6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/content_management/view/create_source_page.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
3939
late final TextEditingController _nameController;
4040
late final TextEditingController _descriptionController;
4141
late final TextEditingController _urlController;
42+
late final TextEditingController _logoUrlController;
4243

4344
@override
4445
void initState() {
@@ -47,13 +48,15 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
4748
_nameController = TextEditingController(text: state.name);
4849
_descriptionController = TextEditingController(text: state.description);
4950
_urlController = TextEditingController(text: state.url);
51+
_logoUrlController = TextEditingController(text: state.logoUrl);
5052
}
5153

5254
@override
5355
void dispose() {
5456
_nameController.dispose();
5557
_descriptionController.dispose();
5658
_urlController.dispose();
59+
_logoUrlController.dispose();
5760
super.dispose();
5861
}
5962

@@ -211,6 +214,17 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
211214
.add(CreateSourceUrlChanged(value)),
212215
),
213216
const SizedBox(height: AppSpacing.lg),
217+
TextFormField(
218+
controller: _logoUrlController,
219+
decoration: InputDecoration(
220+
labelText: l10n.logoUrl,
221+
border: const OutlineInputBorder(),
222+
),
223+
onChanged: (value) => context
224+
.read<CreateSourceBloc>()
225+
.add(CreateSourceLogoUrlChanged(value)),
226+
),
227+
const SizedBox(height: AppSpacing.lg),
214228
SearchableSelectionInput<Language>(
215229
label: l10n.language,
216230
selectedItems: state.language != null

0 commit comments

Comments
 (0)