You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
927 B
35 lines
927 B
2 years ago
|
part of '../neon_news.dart';
|
||
2 years ago
|
|
||
|
class NewsFolderSelect extends StatelessWidget {
|
||
|
const NewsFolderSelect({
|
||
|
required this.folders,
|
||
|
required this.onChanged,
|
||
|
this.value,
|
||
|
super.key,
|
||
|
});
|
||
|
|
||
2 years ago
|
final List<NextcloudNewsFolder> folders;
|
||
|
final void Function(NextcloudNewsFolder?) onChanged;
|
||
|
final NextcloudNewsFolder? value;
|
||
2 years ago
|
|
||
|
@override
|
||
2 years ago
|
Widget build(final BuildContext context) => DropdownButtonFormField<NextcloudNewsFolder>(
|
||
2 years ago
|
decoration: InputDecoration(
|
||
|
hintText: AppLocalizations.of(context).newsFolder,
|
||
|
),
|
||
|
value: value,
|
||
|
items: [
|
||
|
DropdownMenuItem(
|
||
|
child: Text(AppLocalizations.of(context).newsFolderRoot),
|
||
|
),
|
||
|
...folders.map(
|
||
2 years ago
|
(final f) => DropdownMenuItem<NextcloudNewsFolder>(
|
||
2 years ago
|
value: f,
|
||
2 years ago
|
child: Text(f.name),
|
||
2 years ago
|
),
|
||
|
),
|
||
|
],
|
||
|
onChanged: onChanged,
|
||
|
);
|
||
|
}
|