mirror of
https://github.com/foss42/apidash.git
synced 2025-05-22 08:46:33 +08:00
Fix View Code Pane Overflow
This commit is contained in:
@ -10,3 +10,7 @@ bool showButtonLabelsInBodySuccess(int options, double maxWidth) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool showButtonLabelsInViewCodePane(double maxWidth) {
|
||||
return (maxWidth < 400) ? false : true;
|
||||
}
|
||||
|
@ -135,6 +135,11 @@ class _ViewCodePaneState extends State<ViewCodePane> {
|
||||
borderRadius: kBorderRadius8,
|
||||
);
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
var showLabel = showButtonLabelsInViewCodePane(
|
||||
constraints.maxWidth,
|
||||
);
|
||||
return Padding(
|
||||
padding: kP10,
|
||||
child: Column(
|
||||
@ -144,19 +149,19 @@ class _ViewCodePaneState extends State<ViewCodePane> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Code",
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
DropdownButtonCodegenLanguage(
|
||||
child: DropdownButtonCodegenLanguage(
|
||||
codegenLanguage: widget.codegenLanguage,
|
||||
onChanged: widget.onChangedCodegenLanguage,
|
||||
),
|
||||
CopyButton(toCopy: widget.code),
|
||||
),
|
||||
CopyButton(
|
||||
toCopy: widget.code,
|
||||
showLabel: showLabel,
|
||||
),
|
||||
SaveInDownloadsButton(
|
||||
content: stringToBytes(widget.code),
|
||||
mimeType: "application/vnd.dart",
|
||||
showLabel: showLabel,
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -178,5 +183,7 @@ class _ViewCodePaneState extends State<ViewCodePane> {
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user