mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
43
lib/widgets/shared/poster_size_slider.dart
Normal file
43
lib/widgets/shared/poster_size_slider.dart
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/widgets/shared/fladder_slider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class PosterSizeWidget extends ConsumerWidget {
|
||||
final Color? iconColor;
|
||||
final double width;
|
||||
const PosterSizeWidget({this.width = 150, this.iconColor, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
if (ref.watch(clientSettingsProvider.select((value) => value.pinchPosterZoom))) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Tooltip(
|
||||
message: 'Set poster size',
|
||||
child: IconButton(
|
||||
onPressed: () =>
|
||||
ref.read(clientSettingsProvider.notifier).update((current) => current.copyWith(posterSize: 1)),
|
||||
icon: Icon(Icons.photo_size_select_large_rounded),
|
||||
color: iconColor ?? Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: width,
|
||||
child: FladderSlider(
|
||||
value: ref.watch(clientSettingsProvider.select((value) => value.posterSize)),
|
||||
min: 0.5,
|
||||
divisions: 12,
|
||||
max: 1.5,
|
||||
onChanged: (value) =>
|
||||
ref.read(clientSettingsProvider.notifier).update((current) => current.copyWith(posterSize: value)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue