mirror of
https://github.com/foss42/apidash.git
synced 2025-06-22 23:39:11 +08:00
Merge pull request #602 from bavitha01/improve-import-dialog
bugfix: Resolve padding and spacing issues in import dialog UI alignment
This commit is contained in:
@ -432,6 +432,7 @@ const kLabelSelect = "Select";
|
|||||||
const kLabelContinue = "Continue";
|
const kLabelContinue = "Continue";
|
||||||
const kLabelCancel = "Cancel";
|
const kLabelCancel = "Cancel";
|
||||||
const kLabelOk = "Ok";
|
const kLabelOk = "Ok";
|
||||||
|
const kLabelImport = "Import";
|
||||||
const kUntitled = "untitled";
|
const kUntitled = "untitled";
|
||||||
// Request Pane
|
// Request Pane
|
||||||
const kLabelRequest = "Request";
|
const kLabelRequest = "Request";
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import 'package:apidash/consts.dart';
|
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:file_selector/file_selector.dart';
|
import 'package:file_selector/file_selector.dart';
|
||||||
import 'drag_and_drop_area.dart';
|
import 'drag_and_drop_area.dart';
|
||||||
import 'dropdown_import_format.dart';
|
import 'dropdown_import_format.dart';
|
||||||
|
import '../consts.dart';
|
||||||
|
|
||||||
showImportDialog({
|
showImportDialog({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
@ -17,14 +18,15 @@ showImportDialog({
|
|||||||
return StatefulBuilder(
|
return StatefulBuilder(
|
||||||
builder: (context, StateSetter setState) {
|
builder: (context, StateSetter setState) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
contentPadding: const EdgeInsets.all(12),
|
contentPadding: kP12,
|
||||||
content: Column(
|
content: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Text("Import "),
|
const Text(kLabelImport),
|
||||||
|
kHSpacer8,
|
||||||
DropdownButtonImportFormat(
|
DropdownButtonImportFormat(
|
||||||
importFormat: fmt,
|
importFormat: fmt,
|
||||||
onChanged: (format) {
|
onChanged: (format) {
|
||||||
@ -38,6 +40,7 @@ showImportDialog({
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
kVSpacer6,
|
||||||
DragAndDropArea(
|
DragAndDropArea(
|
||||||
onFileDropped: onFileDropped,
|
onFileDropped: onFileDropped,
|
||||||
),
|
),
|
||||||
|
@ -10,13 +10,14 @@ class SidebarTopMenu extends StatelessWidget {
|
|||||||
this.splashRadius = 14,
|
this.splashRadius = 14,
|
||||||
this.tooltip,
|
this.tooltip,
|
||||||
this.shape,
|
this.shape,
|
||||||
|
this.menuPadding,
|
||||||
});
|
});
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final Offset offset;
|
final Offset offset;
|
||||||
final double splashRadius;
|
final double splashRadius;
|
||||||
final String? tooltip;
|
final String? tooltip;
|
||||||
final ShapeBorder? shape;
|
final ShapeBorder? shape;
|
||||||
|
final EdgeInsets? menuPadding;
|
||||||
final Function(SidebarMenuOption)? onSelected;
|
final Function(SidebarMenuOption)? onSelected;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -30,6 +31,7 @@ class SidebarTopMenu extends StatelessWidget {
|
|||||||
offset: offset,
|
offset: offset,
|
||||||
onSelected: onSelected,
|
onSelected: onSelected,
|
||||||
shape: shape,
|
shape: shape,
|
||||||
|
menuPadding: menuPadding,
|
||||||
itemBuilder: (BuildContext context) => SidebarMenuOption.values
|
itemBuilder: (BuildContext context) => SidebarMenuOption.values
|
||||||
.map<PopupMenuEntry<SidebarMenuOption>>(
|
.map<PopupMenuEntry<SidebarMenuOption>>(
|
||||||
(e) => PopupMenuItem<SidebarMenuOption>(
|
(e) => PopupMenuItem<SidebarMenuOption>(
|
||||||
|
@ -26,13 +26,14 @@ const kP4 = EdgeInsets.all(4);
|
|||||||
const kP5 = EdgeInsets.all(5);
|
const kP5 = EdgeInsets.all(5);
|
||||||
const kP6 = EdgeInsets.all(6);
|
const kP6 = EdgeInsets.all(6);
|
||||||
const kP8 = EdgeInsets.all(8);
|
const kP8 = EdgeInsets.all(8);
|
||||||
|
const kP10 = EdgeInsets.all(10);
|
||||||
|
const kP12 = EdgeInsets.all(12);
|
||||||
const kPs8 = EdgeInsets.only(left: 8);
|
const kPs8 = EdgeInsets.only(left: 8);
|
||||||
const kPs2 = EdgeInsets.only(left: 2);
|
const kPs2 = EdgeInsets.only(left: 2);
|
||||||
const kPe4 = EdgeInsets.only(right: 4);
|
const kPe4 = EdgeInsets.only(right: 4);
|
||||||
const kPe8 = EdgeInsets.only(right: 8);
|
const kPe8 = EdgeInsets.only(right: 8);
|
||||||
const kPh20v5 = EdgeInsets.symmetric(horizontal: 20, vertical: 5);
|
const kPh20v5 = EdgeInsets.symmetric(horizontal: 20, vertical: 5);
|
||||||
const kPh20v10 = EdgeInsets.symmetric(horizontal: 20, vertical: 10);
|
const kPh20v10 = EdgeInsets.symmetric(horizontal: 20, vertical: 10);
|
||||||
const kP10 = EdgeInsets.all(10);
|
|
||||||
const kPv2 = EdgeInsets.symmetric(vertical: 2);
|
const kPv2 = EdgeInsets.symmetric(vertical: 2);
|
||||||
const kPv6 = EdgeInsets.symmetric(vertical: 6);
|
const kPv6 = EdgeInsets.symmetric(vertical: 6);
|
||||||
const kPv8 = EdgeInsets.symmetric(vertical: 8);
|
const kPv8 = EdgeInsets.symmetric(vertical: 8);
|
||||||
@ -92,6 +93,7 @@ const kHSpacer20 = SizedBox(width: 20);
|
|||||||
const kHSpacer40 = SizedBox(width: 40);
|
const kHSpacer40 = SizedBox(width: 40);
|
||||||
const kVSpacer3 = SizedBox(height: 3);
|
const kVSpacer3 = SizedBox(height: 3);
|
||||||
const kVSpacer5 = SizedBox(height: 5);
|
const kVSpacer5 = SizedBox(height: 5);
|
||||||
|
const kVSpacer6 = SizedBox(height: 6);
|
||||||
const kVSpacer8 = SizedBox(height: 8);
|
const kVSpacer8 = SizedBox(height: 8);
|
||||||
const kVSpacer10 = SizedBox(height: 10);
|
const kVSpacer10 = SizedBox(height: 10);
|
||||||
const kVSpacer16 = SizedBox(height: 16);
|
const kVSpacer16 = SizedBox(height: 16);
|
||||||
|
Reference in New Issue
Block a user