mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Update widgets
This commit is contained in:
@ -1,18 +1,37 @@
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:file_selector/file_selector.dart';
|
||||
import 'drag_and_drop_area.dart';
|
||||
import 'dropdown_import_format.dart';
|
||||
|
||||
showImportDialog(
|
||||
BuildContext context,
|
||||
Function(XFile) onFileDropped,
|
||||
) {
|
||||
showImportDialog({
|
||||
required BuildContext context,
|
||||
required ImportFormat importFormat,
|
||||
Function(ImportFormat?)? onImportFormatChange,
|
||||
Function(XFile)? onFileDropped,
|
||||
}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
contentPadding: const EdgeInsets.all(12),
|
||||
content: DragAndDropArea(
|
||||
onFileDropped: onFileDropped,
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Import "),
|
||||
DropdownButtonImportFormat(
|
||||
importFormat: importFormat,
|
||||
onChanged: onImportFormatChange,
|
||||
),
|
||||
],
|
||||
),
|
||||
DragAndDropArea(
|
||||
onFileDropped: onFileDropped,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
|
Reference in New Issue
Block a user