A framework for building convergent cross-platform Nextcloud clients using Flutter.
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
874 B

part of '../neon_news.dart';
3 years ago
class NewsFolderSelect extends StatelessWidget {
const NewsFolderSelect({
required this.folders,
required this.onChanged,
this.value,
super.key,
});
final List<NewsFolder> folders;
final void Function(NewsFolder?) onChanged;
final NewsFolder? value;
3 years ago
@override
Widget build(final BuildContext context) => DropdownButtonFormField<NewsFolder>(
3 years ago
decoration: InputDecoration(
hintText: AppLocalizations.of(context).folder,
3 years ago
),
value: value,
items: [
DropdownMenuItem(
child: Text(AppLocalizations.of(context).folderRoot),
3 years ago
),
...folders.map(
(final f) => DropdownMenuItem<NewsFolder>(
3 years ago
value: f,
child: Text(f.name),
3 years ago
),
),
],
onChanged: onChanged,
);
}