fix: Small bugfixes (#303)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-04-06 14:40:58 +02:00 committed by GitHub
parent d96cafecff
commit 5bf4579a49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 48 additions and 51 deletions

View file

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:fladder/models/settings/home_settings_model.dart';
import 'package:fladder/screens/shared/flat_button.dart';
import 'package:fladder/util/adaptive_layout.dart';
import 'package:fladder/widgets/shared/modal_bottom_sheet.dart';
class EnumBox<T> extends StatelessWidget {
final String current;
@ -52,10 +53,11 @@ class EnumBox<T> extends StatelessWidget {
child: useBottomSheet
? FlatButton(
child: labelWidget,
onTap: () => showModalBottomSheet(
onTap: () => showBottomSheetPill(
context: context,
builder: (context) => ListView(
content: (context, scrollController) => ListView(
shrinkWrap: true,
controller: scrollController,
children: [
const SizedBox(height: 6),
...itemBuilder(context),

View file

@ -18,6 +18,7 @@ Future<void> showBottomSheetPill({
ScrollController scrollController,
) content,
}) async {
final screenSize = MediaQuery.sizeOf(context);
await showModalBottomSheet(
isScrollControlled: true,
useRootNavigator: true,
@ -25,9 +26,8 @@ Future<void> showBottomSheetPill({
enableDrag: true,
context: context,
constraints: AdaptiveLayout.viewSizeOf(context) == ViewSize.phone
? BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.9)
: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.75, maxHeight: MediaQuery.of(context).size.height * 0.85),
? BoxConstraints(maxHeight: screenSize.height * 0.9)
: BoxConstraints(maxWidth: screenSize.width * 0.75, maxHeight: screenSize.height * 0.85),
builder: (context) {
final controller = ScrollController();
return ListView(