Skip to content

Commit 41e6c6f

Browse files
YoussefLasheenFeichtmeier
authored andcommitted
Add a dropdown button to choose between image providers
1 parent 6e002f5 commit 41e6c6f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/view/pages/wallpaper/wallpaper_page.dart

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,27 @@ class WallpaperPage extends StatelessWidget {
107107
//TODO: Add the title and copyright info
108108
YaruRow(
109109
enabled: true,
110-
trailingWidget: const Text('Image of the day from Bing'),
110+
leadingWidget: const Text('Image of the day from '),
111+
trailingWidget: DropdownButton<ImageOfTheDayProvider>(
112+
value: model.imageOfTheDayProvider,
113+
onChanged: (value) => model.setUrlWallpaperProvider(value!),
114+
items: const [
115+
DropdownMenuItem(
116+
child: Text('Bing'),
117+
value: ImageOfTheDayProvider.bing,
118+
),
119+
DropdownMenuItem(
120+
child: Text('Nasa'),
121+
value: ImageOfTheDayProvider.nasa,
122+
),
123+
]),
111124
actionWidget: SizedBox(
112125
width: 40,
113126
height: 40,
114127
child: OutlinedButton(
115128
style: OutlinedButton.styleFrom(
116129
padding: const EdgeInsets.all(0)),
117-
onPressed: () async => await model.refreshBingWallpaper(),
130+
onPressed: () async => model.refreshUrlWallpaper(),
118131
child: const Icon(YaruIcons.refresh),
119132
),
120133
)),

0 commit comments

Comments
 (0)