From d10b1d0d22a1d890ae0553bee238290228bd7e43 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 13 Mar 2021 11:48:33 +0100 Subject: [PATCH] Fix issue with large screens --- lib/ui/dialogs/pick_file_dialog.dart | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/ui/dialogs/pick_file_dialog.dart b/lib/ui/dialogs/pick_file_dialog.dart index d058021..f450617 100644 --- a/lib/ui/dialogs/pick_file_dialog.dart +++ b/lib/ui/dialogs/pick_file_dialog.dart @@ -6,6 +6,7 @@ import 'package:comunic/utils/ui_utils.dart'; import 'package:file_picker/file_picker.dart'; import 'package:filesize/filesize.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:image_picker/image_picker.dart'; import 'package:mime/mime.dart'; @@ -197,12 +198,17 @@ class _BottomSheetPickOption extends StatelessWidget { @override Widget build(BuildContext context) => Container( height: 255, - child: ListView.builder( - itemCount: options.length, - itemBuilder: (c, i) => ListTile( - leading: Icon(options[i].icon), - title: Text(options[i].label), - onTap: () => onOptionSelected(options[i].value), + child: Center( + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 400), + child: ListView.builder( + itemCount: options.length, + itemBuilder: (c, i) => ListTile( + leading: Icon(options[i].icon), + title: Text(options[i].label), + onTap: () => onOptionSelected(options[i].value), + ), + ), ), ), );