From 6dd8d37f770ebfb4cdb4611e00495edd0d0b6ea5 Mon Sep 17 00:00:00 2001 From: stonegate Date: Thu, 1 Oct 2020 19:42:52 +0800 Subject: [PATCH] Change default serach engine to podcastindex. --- lib/home/search_podcast.dart | 2 +- lib/service/search_api.dart | 2 +- lib/settings/layouts.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/home/search_podcast.dart b/lib/home/search_podcast.dart index 0023132..f54e321 100644 --- a/lib/home/search_podcast.dart +++ b/lib/home/search_podcast.dart @@ -44,7 +44,7 @@ class MyHomePageDelegate extends SearchDelegate { Future _getSearchEngine() async { final storage = KeyValueStorage(searchEngineKey); - final index = await storage.getInt(defaultValue: 0); + final index = await storage.getInt(); if (_searchEngine == null) { _searchEngine = SearchEngine.values[index]; } diff --git a/lib/service/search_api.dart b/lib/service/search_api.dart index 687d1f7..f297464 100644 --- a/lib/service/search_api.dart +++ b/lib/service/search_api.dart @@ -13,7 +13,7 @@ import '../type/search_api/search_top_podcast.dart'; import '../type/search_api/searchepisodes.dart'; import '../type/search_api/searchpodcast.dart'; -enum SearchEngine { listenNotes, podcastIndex } +enum SearchEngine { podcastIndex, listenNotes } class ListenNotesSearch { final _apiKey = environment['apiKey']; diff --git a/lib/settings/layouts.dart b/lib/settings/layouts.dart index dfd2881..2f7c794 100644 --- a/lib/settings/layouts.dart +++ b/lib/settings/layouts.dart @@ -49,7 +49,7 @@ class _LayoutSettingState extends State { Future _getSearchEngine() async { final storage = KeyValueStorage(searchEngineKey); - final index = await storage.getInt(defaultValue: 0); + final index = await storage.getInt(); return SearchEngine.values[index]; }