Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/devtools_app_shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ getter.
* Move the `Disposable` class from the
`package:devtools_app_shared/service.dart` library to the
`package:devtools_app_shared/utils.dart` library.
* Fix alignment issues in `DevToolsClearableTextField`.

## 0.3.1
* Bump `vm_service` dependency to `>=13.0.0 <16.0.0`.
Expand Down
39 changes: 19 additions & 20 deletions packages/devtools_app_shared/lib/src/ui/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ final class DevToolsClearableTextField extends StatelessWidget {
final bool? enabled;
final bool roundedBorder;

static const _contentVerticalPadding = 6.0;

/// This is the default border radius used by the [OutlineInputBorder]
/// constructor.
static const _defaultInputBorderRadius =
Expand All @@ -45,8 +43,10 @@ final class DevToolsClearableTextField extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
height: defaultTextFieldHeight,
height: defaultTextFieldHeight + densePadding,
child: TextField(
textAlignVertical: TextAlignVertical.center,
cursorHeight: defaultTextFieldHeight / 2,
autofocus: autofocus,
controller: controller,
enabled: enabled,
Expand All @@ -56,10 +56,9 @@ final class DevToolsClearableTextField extends StatelessWidget {
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.only(
top: _contentVerticalPadding,
bottom: _contentVerticalPadding,
top: densePadding,
bottom: densePadding,
left: denseSpacing,
right: densePadding,
),
constraints: BoxConstraints(
minHeight: defaultTextFieldHeight,
Expand All @@ -75,20 +74,20 @@ final class DevToolsClearableTextField extends StatelessWidget {
hintText: hintText,
hintStyle: theme.subtleTextStyle,
prefixIcon: prefixIcon,
suffix: SizedBox(
height: inputDecorationElementHeight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
...additionalSuffixActions,
InputDecorationSuffixButton.clear(
onPressed: () {
controller.clear();
onChanged?.call('');
},
),
],
),
suffixIcon: SizedBox(
height: inputDecorationElementHeight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
...additionalSuffixActions,
InputDecorationSuffixButton.clear(
onPressed: () {
controller.clear();
onChanged?.call('');
},
),
],
),
),
),
),
Expand Down
Loading