mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08:00
[Bugfix] Alertdialog.adaptive was causing issues.
This commit is contained in:
parent
d362f1a039
commit
e0a2c8a3eb
15 changed files with 91 additions and 126 deletions
|
|
@ -1,24 +1,36 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/boxset_model.dart';
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/models/items/photos_model.dart';
|
||||
import 'package:fladder/models/library_search/library_search_model.dart';
|
||||
import 'package:fladder/models/library_search/library_search_options.dart';
|
||||
import 'package:fladder/models/media_playback_model.dart';
|
||||
import 'package:fladder/models/playlist_model.dart';
|
||||
import 'package:fladder/providers/library_search_provider.dart';
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/providers/video_player_provider.dart';
|
||||
import 'package:fladder/screens/collections/add_to_collection.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/library_filter_chips.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/library_sort_dialogue.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/library_views.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/suggestion_search_bar.dart';
|
||||
import 'package:fladder/screens/playlists/add_to_playlists.dart';
|
||||
import 'package:fladder/screens/shared/animated_fade_size.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:fladder/screens/shared/nested_bottom_appbar.dart';
|
||||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/debouncer.dart';
|
||||
import 'package:fladder/util/fab_extended_anim.dart';
|
||||
import 'package:fladder/util/item_base_model/item_base_model_extensions.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/refresh_state.dart';
|
||||
import 'package:fladder/util/sliver_list_padding.dart';
|
||||
import 'package:fladder/widgets/navigation_scaffold/components/floating_player_bar.dart';
|
||||
import 'package:fladder/widgets/navigation_scaffold/components/settings_user_icon.dart';
|
||||
import 'package:fladder/widgets/shared/fladder_scrollbar.dart';
|
||||
|
|
@ -27,22 +39,10 @@ import 'package:fladder/widgets/shared/item_actions.dart';
|
|||
import 'package:fladder/widgets/shared/modal_bottom_sheet.dart';
|
||||
import 'package:fladder/widgets/shared/pinch_poster_zoom.dart';
|
||||
import 'package:fladder/widgets/shared/poster_size_slider.dart';
|
||||
import 'package:fladder/widgets/shared/pull_to_refresh.dart';
|
||||
import 'package:fladder/widgets/shared/scroll_position.dart';
|
||||
import 'package:fladder/widgets/shared/shapes.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/library_search/library_search_model.dart';
|
||||
import 'package:fladder/providers/library_search_provider.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/library_filter_chips.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/library_views.dart';
|
||||
import 'package:fladder/screens/library_search/widgets/suggestion_search_bar.dart';
|
||||
import 'package:fladder/util/debouncer.dart';
|
||||
import 'package:fladder/util/sliver_list_padding.dart';
|
||||
import 'package:fladder/widgets/shared/pull_to_refresh.dart';
|
||||
|
||||
class LibrarySearchScreen extends ConsumerStatefulWidget {
|
||||
final String? viewModelId;
|
||||
final bool? favourites;
|
||||
|
|
@ -139,8 +139,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
child: Scaffold(
|
||||
extendBody: true,
|
||||
extendBodyBehindAppBar: true,
|
||||
floatingActionButtonLocation:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
|
||||
floatingActionButtonLocation: playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
|
||||
floatingActionButton: switch (playerState) {
|
||||
VideoPlayerState.minimized => const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
|
|
@ -198,9 +197,8 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
child: MediaQuery.removeViewInsets(
|
||||
context: context,
|
||||
child: ClipRRect(
|
||||
borderRadius: AdaptiveLayout.of(context).layout == LayoutState.desktop
|
||||
? BorderRadius.circular(15)
|
||||
: BorderRadius.circular(0),
|
||||
borderRadius:
|
||||
AdaptiveLayout.of(context).layout == LayoutState.desktop ? BorderRadius.circular(15) : BorderRadius.circular(0),
|
||||
child: FladderScrollbar(
|
||||
visible: AdaptiveLayout.of(context).inputDevice != InputDevice.pointer,
|
||||
controller: scrollController,
|
||||
|
|
@ -208,8 +206,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
refreshKey: refreshKey,
|
||||
autoFocus: false,
|
||||
contextRefresh: false,
|
||||
onRefresh: () async =>
|
||||
libraryProvider.initRefresh(widget.folderId, widget.viewModelId, widget.favourites),
|
||||
onRefresh: () async => libraryProvider.initRefresh(widget.folderId, widget.viewModelId, widget.favourites),
|
||||
refreshOnStart: false,
|
||||
child: CustomScrollView(
|
||||
physics: const AlwaysScrollableNoImplicitScrollPhysics(),
|
||||
|
|
@ -231,8 +228,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
actions: [
|
||||
const SizedBox(width: 4),
|
||||
Builder(builder: (context) {
|
||||
final isFavorite =
|
||||
librarySearchResults.nestedCurrentItem?.userData.isFavourite == true;
|
||||
final isFavorite = librarySearchResults.nestedCurrentItem?.userData.isFavourite == true;
|
||||
final itemActions = librarySearchResults.nestedCurrentItem?.generateActions(
|
||||
context,
|
||||
ref,
|
||||
|
|
@ -264,7 +260,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
action: () {
|
||||
showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
content: Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final currentType = ref.watch(libraryViewTypeProvider);
|
||||
|
|
@ -280,8 +276,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
(e) => FilledButton.tonal(
|
||||
style: FilledButtonTheme.of(context).style?.copyWith(
|
||||
padding: const WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12, vertical: 24)),
|
||||
EdgeInsets.symmetric(horizontal: 12, vertical: 24)),
|
||||
backgroundColor: WidgetStateProperty.resolveWith(
|
||||
(states) {
|
||||
if (e != currentType) {
|
||||
|
|
@ -317,8 +312,8 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
return Card(
|
||||
elevation: 0,
|
||||
child: Tooltip(
|
||||
message: librarySearchResults.nestedCurrentItem?.type.label(context) ??
|
||||
context.localized.library(1),
|
||||
message:
|
||||
librarySearchResults.nestedCurrentItem?.type.label(context) ?? context.localized.library(1),
|
||||
child: InkWell(
|
||||
onTapUp: (details) async {
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) {
|
||||
|
|
@ -329,9 +324,8 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
position: RelativeRect.fromLTRB(left, top, 40, 100),
|
||||
items: <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
child: Text(
|
||||
librarySearchResults.nestedCurrentItem?.type.label(context) ??
|
||||
context.localized.library(0))),
|
||||
child: Text(librarySearchResults.nestedCurrentItem?.type.label(context) ??
|
||||
context.localized.library(0))),
|
||||
itemCountWidget.toPopupMenuItem(useIcons: true),
|
||||
refreshAction.toPopupMenuItem(useIcons: true),
|
||||
itemViewAction.toPopupMenuItem(useIcons: true),
|
||||
|
|
@ -362,8 +356,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
child: Icon(
|
||||
isFavorite
|
||||
? librarySearchResults.nestedCurrentItem?.type.selectedicon
|
||||
: librarySearchResults.nestedCurrentItem?.type.icon ??
|
||||
IconsaxOutline.document,
|
||||
: librarySearchResults.nestedCurrentItem?.type.icon ?? IconsaxOutline.document,
|
||||
color: isFavorite ? Theme.of(context).colorScheme.primary : null,
|
||||
),
|
||||
),
|
||||
|
|
@ -440,8 +433,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
if (postersList.isNotEmpty)
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
left: MediaQuery.of(context).padding.left,
|
||||
right: MediaQuery.of(context).padding.right),
|
||||
left: MediaQuery.of(context).padding.left, right: MediaQuery.of(context).padding.right),
|
||||
sliver: LibraryViews(
|
||||
key: uniqueKey,
|
||||
items: postersList,
|
||||
|
|
@ -576,8 +568,7 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
|||
},
|
||||
label: Text(context.localized.removeFromCollection),
|
||||
icon: Container(
|
||||
decoration:
|
||||
BoxDecoration(color: Theme.of(context).colorScheme.onPrimary, borderRadius: BorderRadius.circular(6)),
|
||||
decoration: BoxDecoration(color: Theme.of(context).colorScheme.onPrimary, borderRadius: BorderRadius.circular(6)),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(3.0),
|
||||
child: Icon(IconsaxOutline.save_remove, size: 20),
|
||||
|
|
@ -629,8 +620,8 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
|||
clipBehavior: Clip.antiAlias,
|
||||
elevation: 0,
|
||||
borderRadiusGeometry: BorderRadius.circular(6),
|
||||
onTap: () => scrollController.animateTo(0,
|
||||
duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic),
|
||||
onTap: () =>
|
||||
scrollController.animateTo(0, duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
|
|
@ -688,9 +679,8 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
|||
AnimatedFadeSize(
|
||||
child: librarySearchResults.selecteMode
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(16)),
|
||||
decoration:
|
||||
BoxDecoration(color: Theme.of(context).colorScheme.primaryContainer, borderRadius: BorderRadius.circular(16)),
|
||||
child: Row(
|
||||
children: [
|
||||
Tooltip(
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ List<Widget> libraryFilterChips(
|
|||
builder: (context) {
|
||||
return Consumer(
|
||||
builder: (context, ref, child) {
|
||||
return AlertDialog.adaptive(
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.65,
|
||||
child: ListView(
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDia
|
|||
builder: (context) {
|
||||
return StatefulBuilder(
|
||||
builder: (context, state) {
|
||||
return AlertDialog.adaptive(
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.65,
|
||||
child: ListView(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class LoginEditUser extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return AlertDialog.adaptive(
|
||||
return AlertDialog(
|
||||
title: Center(child: Text(user.name)),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final posterSize = MediaQuery.sizeOf(context).width /
|
||||
(AdaptiveLayout.poster(context).gridRatio *
|
||||
ref.watch(clientSettingsProvider.select((value) => value.posterSize)));
|
||||
(AdaptiveLayout.poster(context).gridRatio * ref.watch(clientSettingsProvider.select((value) => value.posterSize)));
|
||||
final decimal = posterSize - posterSize.toInt();
|
||||
final includeAllImages = ref.watch(editItemProvider.select((value) => value.includeAllImages));
|
||||
final images = ref.watch(editItemProvider.select((value) => switch (widget.type) {
|
||||
|
|
@ -86,8 +85,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
|
|||
decoration: BoxDecoration(
|
||||
color: selected ? Theme.of(context).colorScheme.primary : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border:
|
||||
Border.all(color: Colors.transparent, width: 4, strokeAlign: BorderSide.strokeAlignInside),
|
||||
border: Border.all(color: Colors.transparent, width: 4, strokeAlign: BorderSide.strokeAlignInside),
|
||||
),
|
||||
child: Card(
|
||||
color: selected ? Theme.of(context).colorScheme.onPrimary : null,
|
||||
|
|
@ -114,7 +112,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
|
|||
onPressed: () async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text("Delete image"),
|
||||
content: const Text("Deleting is permanent are you sure?"),
|
||||
actions: [
|
||||
|
|
@ -232,8 +230,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
|
|||
children: [...serverImageCards, ...imageCards],
|
||||
),
|
||||
if (loading) const Center(child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)),
|
||||
if (!loading && [...serverImageCards, ...imageCards].isEmpty)
|
||||
Center(child: Text("No ${widget.type.value}s found"))
|
||||
if (!loading && [...serverImageCards, ...imageCards].isEmpty) Center(child: Text("No ${widget.type.value}s found"))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fladder/models/settings/home_settings_model.dart';
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/providers/settings/home_settings_provider.dart';
|
||||
|
|
@ -22,11 +29,6 @@ import 'package:fladder/util/size_formatting.dart';
|
|||
import 'package:fladder/util/theme_mode_extension.dart';
|
||||
import 'package:fladder/widgets/shared/enum_selection.dart';
|
||||
import 'package:fladder/widgets/shared/fladder_slider.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class ClientSettingsPage extends ConsumerStatefulWidget {
|
||||
const ClientSettingsPage({super.key});
|
||||
|
|
@ -36,17 +38,16 @@ class ClientSettingsPage extends ConsumerStatefulWidget {
|
|||
}
|
||||
|
||||
class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
||||
late final nextUpDaysEditor = TextEditingController(
|
||||
text: ref.read(clientSettingsProvider.select((value) => value.nextUpDateCutoff?.inDays ?? 14)).toString());
|
||||
late final nextUpDaysEditor =
|
||||
TextEditingController(text: ref.read(clientSettingsProvider.select((value) => value.nextUpDateCutoff?.inDays ?? 14)).toString());
|
||||
|
||||
late final libraryPageSizeController = TextEditingController(
|
||||
text: ref.read(clientSettingsProvider.select((value) => value.libraryPageSize))?.toString() ?? "");
|
||||
late final libraryPageSizeController =
|
||||
TextEditingController(text: ref.read(clientSettingsProvider.select((value) => value.libraryPageSize))?.toString() ?? "");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final clientSettings = ref.watch(clientSettingsProvider);
|
||||
final showBackground = AdaptiveLayout.of(context).layout != LayoutState.phone &&
|
||||
AdaptiveLayout.of(context).size != ScreenLayout.single;
|
||||
final showBackground = AdaptiveLayout.of(context).layout != LayoutState.phone && AdaptiveLayout.of(context).size != ScreenLayout.single;
|
||||
final currentFolder = ref.watch(syncProvider.notifier).savePath;
|
||||
Locale currentLocale = WidgetsBinding.instance.platformDispatcher.locale;
|
||||
|
||||
|
|
@ -65,14 +66,14 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
onTap: currentFolder != null
|
||||
? () async => await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.localized.pathEditTitle),
|
||||
content: Text(context.localized.pathEditDesc),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
String? selectedDirectory = await FilePicker.platform.getDirectoryPath(
|
||||
dialogTitle: context.localized.pathEditSelect, initialDirectory: currentFolder);
|
||||
String? selectedDirectory = await FilePicker.platform
|
||||
.getDirectoryPath(dialogTitle: context.localized.pathEditSelect, initialDirectory: currentFolder);
|
||||
if (selectedDirectory != null) {
|
||||
ref.read(clientSettingsProvider.notifier).setSyncPath(selectedDirectory);
|
||||
}
|
||||
|
|
@ -84,8 +85,8 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
),
|
||||
)
|
||||
: () async {
|
||||
String? selectedDirectory = await FilePicker.platform.getDirectoryPath(
|
||||
dialogTitle: context.localized.pathEditSelect, initialDirectory: currentFolder);
|
||||
String? selectedDirectory = await FilePicker.platform
|
||||
.getDirectoryPath(dialogTitle: context.localized.pathEditSelect, initialDirectory: currentFolder);
|
||||
if (selectedDirectory != null) {
|
||||
ref.read(clientSettingsProvider.notifier).setSyncPath(selectedDirectory);
|
||||
}
|
||||
|
|
@ -95,7 +96,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
color: Theme.of(context).colorScheme.error,
|
||||
onPressed: () async => await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.localized.pathClearTitle),
|
||||
content: Text(context.localized.pathEditDesc),
|
||||
actions: [
|
||||
|
|
@ -154,9 +155,9 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
initialValue: clientSettings.timeOut ?? const Duration(),
|
||||
);
|
||||
|
||||
ref.read(clientSettingsProvider.notifier).setTimeOut(timePicker != null
|
||||
? Duration(minutes: timePicker.inMinutes, seconds: timePicker.inSeconds % 60)
|
||||
: null);
|
||||
ref
|
||||
.read(clientSettingsProvider.notifier)
|
||||
.setTimeOut(timePicker != null ? Duration(minutes: timePicker.inMinutes, seconds: timePicker.inSeconds % 60) : null);
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
|
|
@ -175,9 +176,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
(entry) => PopupMenuItem(
|
||||
value: entry,
|
||||
child: Text(entry.label(context)),
|
||||
onTap: () => ref
|
||||
.read(homeSettingsProvider.notifier)
|
||||
.update((context) => context.copyWith(carouselSettings: entry)),
|
||||
onTap: () => ref.read(homeSettingsProvider.notifier).update((context) => context.copyWith(carouselSettings: entry)),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
|
@ -197,8 +196,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
(entry) => PopupMenuItem(
|
||||
value: entry,
|
||||
child: Text(entry.label(context)),
|
||||
onTap: () =>
|
||||
ref.read(homeSettingsProvider.notifier).update((context) => context.copyWith(nextUp: entry)),
|
||||
onTap: () => ref.read(homeSettingsProvider.notifier).update((context) => context.copyWith(nextUp: entry)),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
|
@ -225,9 +223,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
fontWeight: currentLocale.languageCode == entry.languageCode ? FontWeight.bold : null,
|
||||
),
|
||||
),
|
||||
onTap: () => ref
|
||||
.read(clientSettingsProvider.notifier)
|
||||
.update((state) => state.copyWith(selectedLocale: entry)),
|
||||
onTap: () => ref.read(clientSettingsProvider.notifier).update((state) => state.copyWith(selectedLocale: entry)),
|
||||
),
|
||||
)
|
||||
];
|
||||
|
|
@ -237,8 +233,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
SettingsListTile(
|
||||
label: Text(context.localized.settingsBlurredPlaceholderTitle),
|
||||
subLabel: Text(context.localized.settingsBlurredPlaceholderDesc),
|
||||
onTap: () =>
|
||||
ref.read(clientSettingsProvider.notifier).setBlurPlaceholders(!clientSettings.blurPlaceHolders),
|
||||
onTap: () => ref.read(clientSettingsProvider.notifier).setBlurPlaceholders(!clientSettings.blurPlaceHolders),
|
||||
trailing: Switch(
|
||||
value: clientSettings.blurPlaceHolders,
|
||||
onChanged: (value) => ref.read(clientSettingsProvider.notifier).setBlurPlaceholders(value),
|
||||
|
|
@ -247,8 +242,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
SettingsListTile(
|
||||
label: Text(context.localized.settingsBlurEpisodesTitle),
|
||||
subLabel: Text(context.localized.settingsBlurEpisodesDesc),
|
||||
onTap: () =>
|
||||
ref.read(clientSettingsProvider.notifier).setBlurEpisodes(!clientSettings.blurUpcomingEpisodes),
|
||||
onTap: () => ref.read(clientSettingsProvider.notifier).setBlurEpisodes(!clientSettings.blurUpcomingEpisodes),
|
||||
trailing: Switch(
|
||||
value: clientSettings.blurUpcomingEpisodes,
|
||||
onChanged: (value) => ref.read(clientSettingsProvider.notifier).setBlurEpisodes(value),
|
||||
|
|
@ -292,9 +286,8 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
)),
|
||||
),
|
||||
SettingsListTile(
|
||||
label: Text(AdaptiveLayout.of(context).isDesktop
|
||||
? context.localized.settingsShowScaleSlider
|
||||
: context.localized.settingsPosterPinch),
|
||||
label: Text(
|
||||
AdaptiveLayout.of(context).isDesktop ? context.localized.settingsShowScaleSlider : context.localized.settingsPosterPinch),
|
||||
onTap: () => ref.read(clientSettingsProvider.notifier).update(
|
||||
(current) => current.copyWith(pinchPosterZoom: !current.pinchPosterZoom),
|
||||
),
|
||||
|
|
@ -321,9 +314,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
max: 1.5,
|
||||
value: clientSettings.posterSize,
|
||||
divisions: 20,
|
||||
onChanged: (value) => ref
|
||||
.read(clientSettingsProvider.notifier)
|
||||
.update((current) => current.copyWith(posterSize: value)),
|
||||
onChanged: (value) => ref.read(clientSettingsProvider.notifier).update((current) => current.copyWith(posterSize: value)),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
|
|
@ -337,7 +328,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
context,
|
||||
label: "${context.localized.theme} ${context.localized.mode}",
|
||||
items: ThemeMode.values,
|
||||
itemBuilder: (type) => RadioListTile(
|
||||
itemBuilder: (type) => RadioListTile.adaptive(
|
||||
value: type,
|
||||
title: Text(type?.label(context) ?? context.localized.other),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
|
|
@ -359,7 +350,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
builder: (context, ref, child) => ListTile(
|
||||
title: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
Checkbox.adaptive(
|
||||
value: type == ref.watch(clientSettingsProvider.select((value) => value.themeColor)),
|
||||
onChanged: (value) => ref.read(clientSettingsProvider.notifier).setThemeColor(type),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class _QuickConnectDialogState extends ConsumerState<QuickConnectDialog> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final user = ref.watch(userProvider);
|
||||
return AlertDialog.adaptive(
|
||||
return AlertDialog(
|
||||
title: Text(context.localized.quickConnectTitle),
|
||||
scrollable: true,
|
||||
content: Column(
|
||||
|
|
@ -58,17 +58,14 @@ class _QuickConnectDialogState extends ConsumerState<QuickConnectDialog> {
|
|||
child: error != null || success != null
|
||||
? Card(
|
||||
key: Key(context.localized.error),
|
||||
color: success == null
|
||||
? Theme.of(context).colorScheme.errorContainer
|
||||
: Theme.of(context).colorScheme.surfaceContainer,
|
||||
color: success == null ? Theme.of(context).colorScheme.errorContainer : Theme.of(context).colorScheme.surfaceContainer,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
success ?? error ?? "",
|
||||
style: TextStyle(
|
||||
color: success == null
|
||||
? Theme.of(context).colorScheme.onErrorContainer
|
||||
: Theme.of(context).colorScheme.onSurface),
|
||||
color:
|
||||
success == null ? Theme.of(context).colorScheme.onErrorContainer : Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
bool containsRoute(CustomRoute route) => widget.location == route.route;
|
||||
|
||||
Widget _leftPane(BuildContext context) {
|
||||
final quickConnectAvailable =
|
||||
ref.watch(userProvider.select((value) => value?.serverConfiguration?.quickConnectAvailable ?? false));
|
||||
final quickConnectAvailable = ref.watch(userProvider.select((value) => value?.serverConfiguration?.quickConnectAvailable ?? false));
|
||||
return SettingsScaffold(
|
||||
label: context.localized.settings,
|
||||
scrollController: scrollController,
|
||||
|
|
@ -174,7 +173,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
final user = ref.read(userProvider);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.localized.logoutUserPopupTitle(user?.name ?? "")),
|
||||
scrollable: true,
|
||||
content: Text(
|
||||
|
|
@ -187,10 +186,8 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom().copyWith(
|
||||
foregroundColor:
|
||||
WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer),
|
||||
backgroundColor:
|
||||
WidgetStatePropertyAll(Theme.of(context).colorScheme.errorContainer),
|
||||
foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer),
|
||||
backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.errorContainer),
|
||||
),
|
||||
onPressed: () async {
|
||||
await ref.read(authProvider.notifier).logOutUser();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ void showAuthOptionsDialogue(
|
|||
) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
scrollable: true,
|
||||
icon: const Icon(IconsaxBold.lock_1),
|
||||
title: Text(context.localized.appLockTitle(currentUser.name)),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Future<void> showDefaultAlertDialog(
|
|||
) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: content != null ? Text(content) : null,
|
||||
actions: [
|
||||
|
|
@ -47,7 +47,7 @@ Future<void> showDefaultActionDialog(
|
|||
) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: content != null ? Text(content) : null,
|
||||
actions: [
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class _PassCodeInputState extends ConsumerState<PassCodeInput> {
|
|||
}
|
||||
}
|
||||
},
|
||||
child: AlertDialog.adaptive(
|
||||
child: AlertDialog(
|
||||
scrollable: true,
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@ Future<void> showSubtitleControls({
|
|||
await showDialog(
|
||||
context: context,
|
||||
barrierColor: Colors.black.withOpacity(0.1),
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
content: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: MediaQuery.sizeOf(context).width * 0.75),
|
||||
child: VideoSubtitleControls(label: label)),
|
||||
constraints: BoxConstraints(minWidth: MediaQuery.sizeOf(context).width * 0.75), child: VideoSubtitleControls(label: label)),
|
||||
),
|
||||
);
|
||||
return;
|
||||
|
|
@ -91,9 +90,7 @@ class _VideoSubtitleControlsState extends ConsumerState<VideoSubtitleControls> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: subSettings != lastSettings
|
||||
? () => provider.resetSettings(value: lastSettings)
|
||||
: null,
|
||||
onPressed: subSettings != lastSettings ? () => provider.resetSettings(value: lastSettings) : null,
|
||||
child: Text(context.localized.clearChanges),
|
||||
),
|
||||
const SizedBox(width: 32),
|
||||
|
|
@ -213,8 +210,7 @@ class _VideoSubtitleControlsState extends ConsumerState<VideoSubtitleControls> {
|
|||
const Icon(Icons.border_color_rounded),
|
||||
...[Colors.white, Colors.yellow, Colors.black, Colors.grey, Colors.transparent].map(
|
||||
(e) => FlatButton(
|
||||
onTap: () =>
|
||||
provider.setOutlineColor(e == Colors.transparent ? e : e.withOpacity(0.85)),
|
||||
onTap: () => provider.setOutlineColor(e == Colors.transparent ? e : e.withOpacity(0.85)),
|
||||
borderRadiusGeometry: BorderRadius.circular(5),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Container(
|
||||
|
|
@ -294,8 +290,7 @@ class _VideoSubtitleControlsState extends ConsumerState<VideoSubtitleControls> {
|
|||
),
|
||||
Text(context.localized.backgroundOpacity),
|
||||
],
|
||||
).addVisiblity(
|
||||
activeKey == null ? controlsHidden : activeKey == const Key('backGroundOpacity')),
|
||||
).addVisiblity(activeKey == null ? controlsHidden : activeKey == const Key('backGroundOpacity')),
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Future<void> openOptionDialogue<T>(
|
|||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog.adaptive(
|
||||
return AlertDialog(
|
||||
title: Text(label),
|
||||
content: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.65,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Future<Duration?> showSimpleDurationPicker({
|
|||
Duration? duration;
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.localized.selectTime),
|
||||
content: SimpleDurationPicker(
|
||||
initialValue: initialValue,
|
||||
|
|
@ -113,10 +113,8 @@ class SimpleDurationPicker extends ConsumerWidget {
|
|||
final parsedValue = int.parse(value);
|
||||
if (parsedValue >= 60) {
|
||||
secondsTextController.text = (parsedValue % 60).toString().padLeft(2, '0');
|
||||
minuteTextController.text = (int.parse(minuteTextController.text) + parsedValue / 60)
|
||||
.floor()
|
||||
.toString()
|
||||
.padLeft(2, '0');
|
||||
minuteTextController.text =
|
||||
(int.parse(minuteTextController.text) + parsedValue / 60).floor().toString().padLeft(2, '0');
|
||||
}
|
||||
onChanged(
|
||||
Duration(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Future<Response<dynamic>?> showDeleteDialog(BuildContext context, ItemBaseModel
|
|||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => AlertDialog.adaptive(
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.localized.deleteItem(item.type.label(context))),
|
||||
content: Text(
|
||||
context.localized.deleteFileFromSystem(item.name),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue