mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Refactor JSON Previewer buttons
This commit is contained in:
@ -177,54 +177,26 @@ class _JsonPreviewerState extends State<JsonPreviewer> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: constraints.minWidth > kMinWindowSize.width
|
children: [
|
||||||
? [
|
ADTextButton(
|
||||||
TextButton(
|
icon: Icons.unfold_more,
|
||||||
onPressed: state.areAllExpanded()
|
showLabel: constraints.minWidth > kMinWindowSize.width,
|
||||||
? null
|
label: 'Expand All',
|
||||||
: state.expandAll,
|
labelTextStyle: kTextStyleButtonSmall,
|
||||||
child: const Text(
|
onPressed:
|
||||||
'Expand All',
|
state.areAllExpanded() ? null : state.expandAll,
|
||||||
style: kTextStyleButtonSmall,
|
),
|
||||||
),
|
ADTextButton(
|
||||||
),
|
icon: Icons.unfold_less,
|
||||||
TextButton(
|
showLabel: constraints.minWidth > kMinWindowSize.width,
|
||||||
onPressed: state.areAllCollapsed()
|
label: 'Collapse All',
|
||||||
? null
|
labelTextStyle: kTextStyleButtonSmall,
|
||||||
: state.collapseAll,
|
onPressed:
|
||||||
child: const Text(
|
state.areAllCollapsed() ? null : state.collapseAll,
|
||||||
'Collapse All',
|
),
|
||||||
style: kTextStyleButtonSmall,
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
IconButton(
|
|
||||||
tooltip: "Expand All",
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
onPressed: state.areAllExpanded()
|
|
||||||
? null
|
|
||||||
: state.expandAll,
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.unfold_more,
|
|
||||||
size: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
tooltip: "Collapse All",
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
onPressed: state.areAllCollapsed()
|
|
||||||
? null
|
|
||||||
: state.collapseAll,
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.unfold_less,
|
|
||||||
size: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: JsonExplorer(
|
child: JsonExplorer(
|
||||||
nodes: state.displayNodes,
|
nodes: state.displayNodes,
|
||||||
|
Reference in New Issue
Block a user