diff --git a/.gitignore b/.gitignore
index 9268964a..4bdfd329 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,6 +50,7 @@ macos/
windows/
web/
ios/
+android/
.vscode/*
icons/
coverage/*
diff --git a/INSTALLATION.md b/INSTALLATION.md
index 05740be7..5673a691 100644
--- a/INSTALLATION.md
+++ b/INSTALLATION.md
@@ -3,7 +3,11 @@
## Windows
Download the latest Windows Installer (64 bit) from [here](https://github.com/foss42/apidash/releases/latest)
-To install it, simply double click on the installer and follow the step by step installation wizard.
+To install it, simply double click on the installer.
+
+If prompted by Windows that **Windows prevented an unrecognized app from running**, click on **Run anyway**.
+
+Now, follow the step by step installation wizard.
## MacOS
diff --git a/README.md b/README.md
index 134abbba..f67c8f17 100644
--- a/README.md
+++ b/README.md
@@ -27,35 +27,41 @@ API Dash can be downloaded from the links below:
.dmg |
Link |
Apple Silicon & Intel |
- Link |
+ Link |
Windows |
.exe |
Link |
64-bit |
- Link |
+ Link |
- Linux |
+ Linux |
.deb |
Link |
amd64 |
- Link |
+ Link |
arm64 |
- Link |
+ Link |
.rpm |
Link |
x86_64 |
- Link |
+ Link |
aarch64 |
- Link |
+ Link |
+
+
+ PKGBUILD (Arch Linux) |
+ Link |
+ x86_64 |
+ Link |
@@ -132,7 +138,7 @@ Here is the complete list of mimetypes that can be directly previewed in API Das
| Image | `image/portable-anymap` | `.pnm` | |
| Image | `image/png` | `.png` | |
| Image | `image/sgi` | `.sgi` | |
-| Image | `image/svg+xml` | `.svg` | Partial support. See issue https://github.com/foss42/apidash/issues/20 |
+| Image | `image/svg+xml` | `.svg` | |
| Image | `image/tiff` | `.tiff` | |
| Image | `image/targa` | `.tga` | |
| Image | `image/vnd.wap.wbmp` | `.wbmp` | |
diff --git a/devtools_options.yaml b/devtools_options.yaml
new file mode 100644
index 00000000..7e7e7f67
--- /dev/null
+++ b/devtools_options.yaml
@@ -0,0 +1 @@
+extensions:
diff --git a/lib/app.dart b/lib/app.dart
index ca9e7be0..3f6b2a53 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -1,9 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:window_manager/window_manager.dart';
+import 'package:window_manager/window_manager.dart' hide WindowCaption;
+import 'widgets/widgets.dart' show WindowCaption;
import 'providers/providers.dart';
import 'screens/screens.dart';
-import 'consts.dart' show kFontFamily, kFontFamilyFallback, kColorSchemeSeed;
+import 'consts.dart';
class App extends ConsumerStatefulWidget {
const App({super.key});
@@ -38,7 +39,7 @@ class _AppState extends ConsumerState with WindowListener {
@override
Widget build(BuildContext context) {
- return const DashApp();
+ return const Dashboard();
}
@override
@@ -63,6 +64,7 @@ class _DashAppState extends ConsumerState {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
+ visualDensity: VisualDensity.adaptivePlatformDensity,
fontFamily: kFontFamily,
fontFamilyFallback: kFontFamilyFallback,
colorSchemeSeed: kColorSchemeSeed,
@@ -77,7 +79,25 @@ class _DashAppState extends ConsumerState {
brightness: Brightness.dark,
),
themeMode: isDarkMode ? ThemeMode.dark : ThemeMode.light,
- home: const Dashboard(),
+ home: kIsMobile
+ ? const MobileDashboard(
+ title: 'Requests',
+ scaffoldBody: CollectionPane(),
+ )
+ : Stack(
+ children: [
+ kIsLinux ? const Dashboard() : const App(),
+ if (kIsWindows)
+ SizedBox(
+ height: 29,
+ child: WindowCaption(
+ backgroundColor: Colors.transparent,
+ brightness:
+ isDarkMode ? Brightness.dark : Brightness.light,
+ ),
+ ),
+ ],
+ ),
);
}
}
diff --git a/lib/codegen/codegen.dart b/lib/codegen/codegen.dart
index 356854f6..1aec7144 100644
--- a/lib/codegen/codegen.dart
+++ b/lib/codegen/codegen.dart
@@ -1,6 +1,7 @@
import 'package:apidash/models/models.dart' show RequestModel;
import 'package:apidash/consts.dart';
import 'dart/http.dart';
+import 'dart/dio.dart';
import 'kotlin/okhttp.dart';
import 'python/http_client.dart';
import 'python/requests.dart';
@@ -22,6 +23,8 @@ class Codegen {
return HARCodeGen().getCode(requestModel, defaultUriScheme);
case CodegenLanguage.dartHttp:
return DartHttpCodeGen().getCode(requestModel, defaultUriScheme);
+ case CodegenLanguage.dartDio:
+ return DartDioCodeGen().getCode(requestModel, defaultUriScheme);
case CodegenLanguage.jsAxios:
return AxiosCodeGen().getCode(requestModel, defaultUriScheme);
case CodegenLanguage.jsFetch:
@@ -39,8 +42,6 @@ class Codegen {
.getCode(requestModel, defaultUriScheme);
case CodegenLanguage.pythonRequests:
return PythonRequestsCodeGen().getCode(requestModel, defaultUriScheme);
- default:
- throw ArgumentError('Invalid codegenLanguage');
}
}
}
diff --git a/lib/codegen/dart/dio.dart b/lib/codegen/dart/dio.dart
new file mode 100644
index 00000000..c4a7ed8e
--- /dev/null
+++ b/lib/codegen/dart/dio.dart
@@ -0,0 +1,148 @@
+import 'dart:convert';
+import 'package:code_builder/code_builder.dart';
+import 'package:dart_style/dart_style.dart';
+import 'package:apidash/models/request_model.dart' show RequestModel;
+import 'package:apidash/consts.dart';
+import 'shared.dart';
+
+class DartDioCodeGen {
+ String? getCode(
+ RequestModel requestModel,
+ String defaultUriScheme,
+ ) {
+ try {
+ String url = requestModel.url;
+ if (!url.contains("://") && url.isNotEmpty) {
+ url = "$defaultUriScheme://$url";
+ }
+ final next = generatedDartCode(
+ url: url,
+ method: requestModel.method,
+ queryParams: requestModel.enabledParamsMap,
+ headers: requestModel.enabledHeadersMap,
+ body: requestModel.requestBody,
+ contentType: requestModel.requestBodyContentType,
+ formData: requestModel.formDataMapList,
+ );
+ return next;
+ } catch (e) {
+ return null;
+ }
+ }
+
+ String generatedDartCode({
+ required String url,
+ required HTTPVerb method,
+ required Map queryParams,
+ required Map headers,
+ required String? body,
+ required ContentType contentType,
+ required List