Revert "Fixed the responsiveness of the view code header"

This reverts commit e2d232f462a3a87a3e2d953ec9255a28fd249ef2.
This commit is contained in:
morpheus-30
2023-07-04 23:20:40 +05:30
parent 2833c871fe
commit 51f9a44f58
3 changed files with 14 additions and 30 deletions

View File

@ -40,7 +40,7 @@ class _CopyButtonState extends State<CopyButton> {
Icons.content_copy, Icons.content_copy,
size: 20, size: 20,
), ),
if (widget.showLabel) Text(MediaQuery.of(context).size.width > 1315 ? kLabelCopy : '') if (widget.showLabel) const Text(kLabelCopy)
], ],
), ),
), ),
@ -156,7 +156,7 @@ class _SaveInDownloadsButtonState extends State<SaveInDownloadsButton> {
Icons.download, Icons.download,
size: 20, size: 20,
), ),
if (widget.showLabel) Text(MediaQuery.of(context).size.width > 1315 ? kLabelDownload : '') if (widget.showLabel) const Text(kLabelDownload)
], ],
), ),
), ),

View File

@ -140,36 +140,23 @@ class _ViewCodePaneState extends State<ViewCodePane> {
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: kHeaderHeight*2, height: kHeaderHeight,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Flexible( Expanded(
flex: 1,
child: Text( child: Text(
"Code", "Code",
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context).textTheme.titleMedium,
), ),
), ),
Flexible( DropdownButtonCodegenLanguage(
flex: 3,
child: DropdownButtonCodegenLanguage(
codegenLanguage: widget.codegenLanguage, codegenLanguage: widget.codegenLanguage,
onChanged: widget.onChangedCodegenLanguage, onChanged: widget.onChangedCodegenLanguage,
), ),
), CopyButton(toCopy: widget.code),
Flexible( SaveInDownloadsButton(
flex: MediaQuery.of(context).size.width>1350?2:1,
child: CopyButton(
toCopy: widget.code,
),
),
Flexible(
flex: MediaQuery.of(context).size.width>1350?2:1,
child: SaveInDownloadsButton(
content: stringToBytes(widget.code), content: stringToBytes(widget.code),
mimeType: "application/vnd.dart", mimeType: "application/vnd.dart",
),
) )
], ],
), ),

View File

@ -151,14 +151,11 @@ class _DropdownButtonCodegenLanguageState
value: value, value: value,
child: Padding( child: Padding(
padding: kPs8, padding: kPs8,
child: SizedBox(
width: MediaQuery.of(context).size.width <1315?MediaQuery.of(context).size.width * 0.1:MediaQuery.of(context).size.width * 0.09,
child: Text( child: Text(
value.label, value.label,
style: kTextStyleButton, style: kTextStyleButton,
), ),
), ),
),
); );
}).toList(), }).toList(),
); );