Skip to content

Commit

Permalink
Add usesSafeArea option to the input
Browse files Browse the repository at this point in the history
  • Loading branch information
demchenkoalex committed Jun 9, 2024
1 parent 5dfa912 commit ff2bc8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/assets/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"size": 585000,
"status": "seen",
"type": "image",
"uri": "https://source.unsplash.com/WBGjg0DsO_g/1920x1280",
"uri": "https://images.unsplash.com/photo-1539037116277-4db20889f2d4",
"width": 1920
},
{
Expand Down
6 changes: 5 additions & 1 deletion lib/src/widgets/input/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class _InputState extends State<Input> {
.theme
.inputPadding
.copyWith(left: 16, right: 16);
final safeAreaInsets = isMobile
final safeAreaInsets = widget.options.usesSafeArea && isMobile
? EdgeInsets.fromLTRB(
query.padding.left,
0,
Expand Down Expand Up @@ -264,6 +264,7 @@ class InputOptions {
this.autofocus = false,
this.enableSuggestions = true,
this.enabled = true,
this.usesSafeArea = true,
});

/// Controls the [Input] clear behavior. Defaults to [InputClearMode.always].
Expand Down Expand Up @@ -302,4 +303,7 @@ class InputOptions {

/// Controls the [TextInput] enabled behavior. Defaults to [true].
final bool enabled;

/// Controls the [Input] usesSafeArea behavior. Defaults to [true].
final bool usesSafeArea;
}

0 comments on commit ff2bc8a

Please sign in to comment.