feat: show country code piped instance list

This commit is contained in:
Kingkor Roy Tirtho 2023-06-28 14:23:12 +06:00
parent 17a25a501e
commit 60328a6baf
2 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import 'package:flutter_desktop_tools/flutter_desktop_tools.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:piped_client/piped_client.dart';
import 'package:spotube/collections/env.dart'; import 'package:spotube/collections/env.dart';
import 'package:spotube/collections/language_codes.dart'; import 'package:spotube/collections/language_codes.dart';
@ -306,7 +307,10 @@ class SettingsPage extends HookConsumerWidget {
.map( .map(
(e) => DropdownMenuItem( (e) => DropdownMenuItem(
value: e.apiUrl, value: e.apiUrl,
child: Text(e.name), child: Text(
"${e.name}\n"
"${e.locations.map(countryCodeToEmoji).join(" ")}",
),
), ),
) )
.toList(), .toList(),
@ -325,7 +329,7 @@ class SettingsPage extends HookConsumerWidget {
); );
}), }),
AdaptiveSelectTile<SearchMode>( AdaptiveSelectTile<SearchMode>(
secondary: const Icon(SpotubeIcons.youtube), secondary: const Icon(SpotubeIcons.search),
title: Text(context.l10n.search_mode), title: Text(context.l10n.search_mode),
value: preferences.searchMode, value: preferences.searchMode,
options: SearchMode.values options: SearchMode.values

View File

@ -83,7 +83,7 @@ class UserPreferences extends PersistedChangeNotifier {
this.showSystemTrayIcon = true, this.showSystemTrayIcon = true,
this.locale = const Locale("system", "system"), this.locale = const Locale("system", "system"),
this.pipedInstance = "https://pipedapi.kavin.rocks", this.pipedInstance = "https://pipedapi.kavin.rocks",
this.searchMode = SearchMode.youtubeMusic, this.searchMode = SearchMode.youtube,
this.skipNonMusic = true, this.skipNonMusic = true,
}) : super() { }) : super() {
if (downloadLocation.isEmpty) { if (downloadLocation.isEmpty) {