mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-14 17:55:58 -07:00
fix: Small bugfixes (#303)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
d96cafecff
commit
5bf4579a49
8 changed files with 48 additions and 51 deletions
|
|
@ -94,6 +94,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||||
controller: AdaptiveLayout.scrollOf(context),
|
controller: AdaptiveLayout.scrollOf(context),
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
|
const DefaultSliverTopBadding(),
|
||||||
if (AdaptiveLayout.viewSizeOf(context) == ViewSize.phone)
|
if (AdaptiveLayout.viewSizeOf(context) == ViewSize.phone)
|
||||||
NestedSliverAppBar(
|
NestedSliverAppBar(
|
||||||
route: LibrarySearchRoute(),
|
route: LibrarySearchRoute(),
|
||||||
|
|
@ -107,7 +108,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
const DefaultSliverTopBadding(),
|
|
||||||
if (AdaptiveLayout.of(context).isDesktop)
|
if (AdaptiveLayout.of(context).isDesktop)
|
||||||
const SliverToBoxAdapter(
|
const SliverToBoxAdapter(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:iconsax_plus/iconsax_plus.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||||
|
|
||||||
import 'package:fladder/models/boxset_model.dart';
|
import 'package:fladder/models/boxset_model.dart';
|
||||||
import 'package:fladder/models/item_base_model.dart';
|
import 'package:fladder/models/item_base_model.dart';
|
||||||
|
|
@ -685,10 +685,11 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.primaryContainer,
|
color: Theme.of(context).colorScheme.primaryContainer,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
IconsaxPlusLinear.arrow_up_3,
|
IconsaxPlusLinear.arrow_up,
|
||||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,7 @@ List<Widget> buildClientSettingsVisual(
|
||||||
label: Text(context.localized.displayLanguage),
|
label: Text(context.localized.displayLanguage),
|
||||||
trailing: Localizations.override(
|
trailing: Localizations.override(
|
||||||
context: context,
|
context: context,
|
||||||
locale: ref.watch(
|
locale: ref.watch(clientSettingsProvider.select((value) => (value.selectedLocale ?? currentLocale))),
|
||||||
clientSettingsProvider.select((value) => (value.selectedLocale ?? currentLocale)),
|
|
||||||
),
|
|
||||||
child: Builder(builder: (context) {
|
child: Builder(builder: (context) {
|
||||||
String language = "Unknown";
|
String language = "Unknown";
|
||||||
try {
|
try {
|
||||||
|
|
@ -49,9 +47,7 @@ List<Widget> buildClientSettingsVisual(
|
||||||
context: context,
|
context: context,
|
||||||
locale: entry,
|
locale: entry,
|
||||||
child: Builder(builder: (context) {
|
child: Builder(builder: (context) {
|
||||||
return Text(
|
return Text("${context.localized.nativeName} (${entry.languageCode.toUpperCase()})");
|
||||||
context.localized.nativeName,
|
|
||||||
);
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
onTap: () => ref
|
onTap: () => ref
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
||||||
.update((current) => current.copyWith(mouseDragSupport: !clientSettings.mouseDragSupport)),
|
.update((current) => current.copyWith(mouseDragSupport: !clientSettings.mouseDragSupport)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const Divider(),
|
||||||
],
|
],
|
||||||
const Divider(),
|
|
||||||
...buildClientSettingsAdvanced(context, ref),
|
...buildClientSettingsAdvanced(context, ref),
|
||||||
if (kDebugMode) ...[
|
if (kDebugMode) ...[
|
||||||
const SizedBox(height: 64),
|
const SizedBox(height: 64),
|
||||||
|
|
|
||||||
|
|
@ -31,44 +31,41 @@ class SettingsListTile extends StatelessWidget {
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8))),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8))),
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: MediaQuery(
|
child: ListTile(
|
||||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
minVerticalPadding: 12,
|
||||||
child: ListTile(
|
minLeadingWidth: 16,
|
||||||
minVerticalPadding: 12,
|
minTileHeight: 75,
|
||||||
minLeadingWidth: 16,
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||||
minTileHeight: 75,
|
horizontalTitleGap: 0,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
titleAlignment: ListTileTitleAlignment.center,
|
||||||
horizontalTitleGap: 0,
|
contentPadding: const EdgeInsets.only(right: 12, left: 2),
|
||||||
titleAlignment: ListTileTitleAlignment.center,
|
leading: (suffix ?? iconWidget) != null
|
||||||
contentPadding: const EdgeInsets.only(right: 12, left: 2),
|
? Padding(
|
||||||
leading: (suffix ?? iconWidget) != null
|
padding: const EdgeInsets.only(left: 8.0, right: 16.0),
|
||||||
? Padding(
|
child: AnimatedContainer(
|
||||||
padding: const EdgeInsets.only(left: 8.0, right: 16.0),
|
duration: const Duration(milliseconds: 125),
|
||||||
child: AnimatedContainer(
|
decoration: BoxDecoration(
|
||||||
duration: const Duration(milliseconds: 125),
|
color: Theme.of(context).colorScheme.primaryContainer.withValues(alpha: selected ? 1 : 0),
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(selected ? 5 : 20),
|
||||||
color: Theme.of(context).colorScheme.primaryContainer.withValues(alpha: selected ? 1 : 0),
|
|
||||||
borderRadius: BorderRadius.circular(selected ? 5 : 20),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12),
|
|
||||||
child: (suffix ?? iconWidget),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
child: Padding(
|
||||||
: suffix ?? const SizedBox(),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12),
|
||||||
title: label,
|
child: (suffix ?? iconWidget),
|
||||||
titleTextStyle: Theme.of(context).textTheme.titleLarge,
|
),
|
||||||
trailing: Padding(
|
),
|
||||||
padding: const EdgeInsets.only(left: 16),
|
)
|
||||||
child: trailing,
|
: suffix ?? const SizedBox(),
|
||||||
),
|
title: label,
|
||||||
selected: selected,
|
titleTextStyle: Theme.of(context).textTheme.titleLarge,
|
||||||
textColor: contentColor,
|
trailing: Padding(
|
||||||
iconColor: contentColor,
|
padding: const EdgeInsets.only(left: 16),
|
||||||
subtitle: subLabel,
|
child: trailing,
|
||||||
onTap: onTap,
|
|
||||||
),
|
),
|
||||||
|
selected: selected,
|
||||||
|
textColor: contentColor,
|
||||||
|
iconColor: contentColor,
|
||||||
|
subtitle: subLabel,
|
||||||
|
onTap: onTap,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
|
||||||
key: _key,
|
key: _key,
|
||||||
appBar: const FladderAppBar(),
|
appBar: const FladderAppBar(),
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
floatingActionButtonAnimator:
|
floatingActionButtonAnimator:
|
||||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:fladder/models/settings/home_settings_model.dart';
|
import 'package:fladder/models/settings/home_settings_model.dart';
|
||||||
import 'package:fladder/screens/shared/flat_button.dart';
|
import 'package:fladder/screens/shared/flat_button.dart';
|
||||||
import 'package:fladder/util/adaptive_layout.dart';
|
import 'package:fladder/util/adaptive_layout.dart';
|
||||||
|
import 'package:fladder/widgets/shared/modal_bottom_sheet.dart';
|
||||||
|
|
||||||
class EnumBox<T> extends StatelessWidget {
|
class EnumBox<T> extends StatelessWidget {
|
||||||
final String current;
|
final String current;
|
||||||
|
|
@ -52,10 +53,11 @@ class EnumBox<T> extends StatelessWidget {
|
||||||
child: useBottomSheet
|
child: useBottomSheet
|
||||||
? FlatButton(
|
? FlatButton(
|
||||||
child: labelWidget,
|
child: labelWidget,
|
||||||
onTap: () => showModalBottomSheet(
|
onTap: () => showBottomSheetPill(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => ListView(
|
content: (context, scrollController) => ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
controller: scrollController,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
...itemBuilder(context),
|
...itemBuilder(context),
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ Future<void> showBottomSheetPill({
|
||||||
ScrollController scrollController,
|
ScrollController scrollController,
|
||||||
) content,
|
) content,
|
||||||
}) async {
|
}) async {
|
||||||
|
final screenSize = MediaQuery.sizeOf(context);
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
|
@ -25,9 +26,8 @@ Future<void> showBottomSheetPill({
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
context: context,
|
context: context,
|
||||||
constraints: AdaptiveLayout.viewSizeOf(context) == ViewSize.phone
|
constraints: AdaptiveLayout.viewSizeOf(context) == ViewSize.phone
|
||||||
? BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.9)
|
? BoxConstraints(maxHeight: screenSize.height * 0.9)
|
||||||
: BoxConstraints(
|
: BoxConstraints(maxWidth: screenSize.width * 0.75, maxHeight: screenSize.height * 0.85),
|
||||||
maxWidth: MediaQuery.of(context).size.width * 0.75, maxHeight: MediaQuery.of(context).size.height * 0.85),
|
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final controller = ScrollController();
|
final controller = ScrollController();
|
||||||
return ListView(
|
return ListView(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue