Skip to content

Commit f33ff02

Browse files
authored
Merge pull request #602 from bavitha01/improve-import-dialog
bugfix: Resolve padding and spacing issues in import dialog UI alignment
2 parents 17f2a56 + d6dcf50 commit f33ff02

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

lib/consts.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ const kLabelSelect = "Select";
432432
const kLabelContinue = "Continue";
433433
const kLabelCancel = "Cancel";
434434
const kLabelOk = "Ok";
435+
const kLabelImport = "Import";
435436
const kUntitled = "untitled";
436437
// Request Pane
437438
const kLabelRequest = "Request";

lib/widgets/dialog_import.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import 'package:apidash/consts.dart';
1+
import 'package:apidash_design_system/apidash_design_system.dart';
22
import 'package:flutter/material.dart';
33
import 'package:file_selector/file_selector.dart';
44
import 'drag_and_drop_area.dart';
55
import 'dropdown_import_format.dart';
6+
import '../consts.dart';
67

78
showImportDialog({
89
required BuildContext context,
@@ -17,14 +18,15 @@ showImportDialog({
1718
return StatefulBuilder(
1819
builder: (context, StateSetter setState) {
1920
return AlertDialog(
20-
contentPadding: const EdgeInsets.all(12),
21+
contentPadding: kP12,
2122
content: Column(
2223
mainAxisSize: MainAxisSize.min,
2324
children: [
2425
Row(
2526
mainAxisAlignment: MainAxisAlignment.center,
2627
children: [
27-
const Text("Import "),
28+
const Text(kLabelImport),
29+
kHSpacer8,
2830
DropdownButtonImportFormat(
2931
importFormat: fmt,
3032
onChanged: (format) {
@@ -38,6 +40,7 @@ showImportDialog({
3840
),
3941
],
4042
),
43+
kVSpacer6,
4144
DragAndDropArea(
4245
onFileDropped: onFileDropped,
4346
),

lib/widgets/menu_sidebar_top.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ class SidebarTopMenu extends StatelessWidget {
1010
this.splashRadius = 14,
1111
this.tooltip,
1212
this.shape,
13+
this.menuPadding,
1314
});
1415
final Widget? child;
1516
final Offset offset;
1617
final double splashRadius;
1718
final String? tooltip;
1819
final ShapeBorder? shape;
19-
20+
final EdgeInsets? menuPadding;
2021
final Function(SidebarMenuOption)? onSelected;
2122

2223
@override
@@ -30,6 +31,7 @@ class SidebarTopMenu extends StatelessWidget {
3031
offset: offset,
3132
onSelected: onSelected,
3233
shape: shape,
34+
menuPadding: menuPadding,
3335
itemBuilder: (BuildContext context) => SidebarMenuOption.values
3436
.map<PopupMenuEntry<SidebarMenuOption>>(
3537
(e) => PopupMenuItem<SidebarMenuOption>(

packages/apidash_design_system/lib/tokens/measurements.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ const kP4 = EdgeInsets.all(4);
2626
const kP5 = EdgeInsets.all(5);
2727
const kP6 = EdgeInsets.all(6);
2828
const kP8 = EdgeInsets.all(8);
29+
const kP10 = EdgeInsets.all(10);
30+
const kP12 = EdgeInsets.all(12);
2931
const kPs8 = EdgeInsets.only(left: 8);
3032
const kPs2 = EdgeInsets.only(left: 2);
3133
const kPe4 = EdgeInsets.only(right: 4);
3234
const kPe8 = EdgeInsets.only(right: 8);
3335
const kPh20v5 = EdgeInsets.symmetric(horizontal: 20, vertical: 5);
3436
const kPh20v10 = EdgeInsets.symmetric(horizontal: 20, vertical: 10);
35-
const kP10 = EdgeInsets.all(10);
3637
const kPv2 = EdgeInsets.symmetric(vertical: 2);
3738
const kPv6 = EdgeInsets.symmetric(vertical: 6);
3839
const kPv8 = EdgeInsets.symmetric(vertical: 8);
@@ -92,6 +93,7 @@ const kHSpacer20 = SizedBox(width: 20);
9293
const kHSpacer40 = SizedBox(width: 40);
9394
const kVSpacer3 = SizedBox(height: 3);
9495
const kVSpacer5 = SizedBox(height: 5);
96+
const kVSpacer6 = SizedBox(height: 6);
9597
const kVSpacer8 = SizedBox(height: 8);
9698
const kVSpacer10 = SizedBox(height: 10);
9799
const kVSpacer16 = SizedBox(height: 16);

0 commit comments

Comments
 (0)