Skip to content

Commit

Permalink
NativeViewDetails: make key and value take equal space (doesn't look …
Browse files Browse the repository at this point in the history
…good)
  • Loading branch information
bartekpacia committed Nov 7, 2023
1 parent e8a49fd commit f27ef5e
Showing 1 changed file with 35 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,43 @@ class _NodeDetails extends StatelessWidget {
return MouseRegion(
onEnter: (_) => displayCopyButton.value = true,
onExit: (_) => displayCopyButton.value = false,
child: OverflowingFlex(
direction: Axis.horizontal,
child: Stack(
children: [
Text(item.key),
const SizedBox(width: 4),
Text(
item.value,
style: item.important ? null : unimportantTextStyle,
OverflowingFlex(
direction: Axis.horizontal,
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 4),
child: Text(item.key, maxLines: 1),
),
),
Flexible(
child: Text(
item.value,
style: item.important
? null
: unimportantTextStyle,
maxLines: 1,
),
),
],
),
Opacity(
opacity: displayCopyButton.value ? 1 : 0,
child: IconButton(
iconSize: defaultIconSize,
onPressed: displayCopyButton.value
? () {
Clipboard.setData(
ClipboardData(text: item.copyValue),
);
}
: null,
icon: const Icon(Icons.copy),
Align(
alignment: Alignment.centerRight,
child: Opacity(
opacity: displayCopyButton.value ? 1 : 0,
child: IconButton(
iconSize: defaultIconSize,
onPressed: displayCopyButton.value
? () {
Clipboard.setData(
ClipboardData(text: item.copyValue),
);
}
: null,
icon: const Icon(Icons.copy),
),
),
),
],
Expand Down

0 comments on commit f27ef5e

Please sign in to comment.