mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-29 23:38:50 +02:00
The download- and metadata-provider priority pages were 99% identical. Extract ProviderPriorityListPage taking the provider-list load/save callbacks and labels; both pages become thin wrappers. (The metadata page's explicit saveLabel was the same dialogSave the scaffold already defaults to.)
24 lines
970 B
Dart
24 lines
970 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:spotiflac_android/l10n/l10n.dart';
|
|
import 'package:spotiflac_android/providers/extension_provider.dart';
|
|
import 'package:spotiflac_android/screens/settings/provider_priority_list_page.dart';
|
|
|
|
class ProviderPriorityPage extends StatelessWidget {
|
|
const ProviderPriorityPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ProviderPriorityListPage(
|
|
loadAllProviders: (ref) =>
|
|
ref.read(extensionProvider.notifier).getAllDownloadProviders(),
|
|
currentPriority: (ref) => ref.read(extensionProvider).providerPriority,
|
|
save: (ref, priority) =>
|
|
ref.read(extensionProvider.notifier).setProviderPriority(priority),
|
|
title: (c) => c.l10n.providerPriorityTitle,
|
|
description: (c) => c.l10n.providerPriorityDescription,
|
|
infoText: (c) => c.l10n.providerPriorityInfo,
|
|
savedSnackbar: (c) => c.l10n.snackbarProviderPrioritySaved,
|
|
);
|
|
}
|
|
}
|