Skip to content

Commit

Permalink
fix: Fixed height of attachments sheet on message input (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecoomber authored Jan 2, 2025
1 parent 806433e commit 7b7aca1
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions lib/src/components/organisms/chat/message_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -388,44 +388,46 @@ class ZdsMessageInputState extends State<ZdsMessageInput> with SingleTickerProvi
enforceSheet: true,
backgroundColor: zetaColors.surfacePrimary,
context: context,
headerBuilder: (context) {
return PreferredSize(
preferredSize: const Size.fromHeight(48),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(ZdsIcons.close, size: 20),
onPressed: Navigator.of(context).pop,
color: zetaColors.iconSubtle,
),
FittedBox(
fit: BoxFit.cover,
child: Text(
ComponentStrings.of(context).get('ATTACHMENTS', 'Attachments'),
style: themeData.textTheme.titleMedium,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
const SizedBox(width: 48),
],
),
);
},
maxHeight: 200,
builder: (_) {
return Scaffold(
body: Material(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 48,
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(ZdsIcons.close, size: 24),
onPressed: Navigator.of(context).pop,
color: zetaColors.iconSubtle,
),
Text(
ComponentStrings.of(context).get('ATTACHMENTS', 'Attachments'),
style: themeData.textTheme.headlineMedium,
),
const SizedBox(width: 48),
],
),
),
ZdsFilePicker(
useCard: false,
config: _moreConfig,
showSelected: false,
controller: modalController,
onChange: (files) {
if (files.isNotEmpty) Navigator.of(context).pop(files.first);
},
onError: widget.onUploadError,
postProcessors: widget.postProcessors,
).paddingOnly(top: 24, bottom: 24),
],
),
child: ZdsFilePicker(
useCard: false,
config: _moreConfig,
showSelected: false,
controller: modalController,
onChange: (files) {
if (files.isNotEmpty) Navigator.of(context).pop(files.first);
},
onError: widget.onUploadError,
postProcessors: widget.postProcessors,
).paddingOnly(top: 24, bottom: 24),
),
);
},
Expand Down

0 comments on commit 7b7aca1

Please sign in to comment.