Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flutter web support on jaguar dart #3786

Merged
merged 1 commit into from Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,6 @@
library {{pubName}}.api;

import 'package:http/io_client.dart';
import 'package:http/http.dart' as http;
import 'package:jaguar_serializer/jaguar_serializer.dart';
{{#protoFormat}}
import 'package:jaguar_serializer_protobuf/proto_repo.dart';
Expand Down Expand Up @@ -52,7 +52,7 @@ class {{clientName}} {
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
{{clientName}}({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
Expand Down
@@ -1,6 +1,6 @@
library openapi.api;

import 'package:http/io_client.dart';
import 'package:http/http.dart' as http;
import 'package:jaguar_serializer/jaguar_serializer.dart';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
import 'package:openapi/auth/api_key_auth.dart';
Expand Down Expand Up @@ -47,7 +47,7 @@ class Openapi {
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
Expand Down
@@ -1,6 +1,6 @@
library openapi.api;

import 'package:http/io_client.dart';
import 'package:http/http.dart' as http;
import 'package:jaguar_serializer/jaguar_serializer.dart';
import 'package:jaguar_serializer_protobuf/proto_repo.dart';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
Expand Down Expand Up @@ -57,7 +57,7 @@ class Openapi {
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/dart-jaguar/openapi/lib/api.dart
@@ -1,6 +1,6 @@
library openapi.api;

import 'package:http/io_client.dart';
import 'package:http/http.dart' as http;
import 'package:jaguar_serializer/jaguar_serializer.dart';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
import 'package:openapi/auth/api_key_auth.dart';
Expand Down Expand Up @@ -47,7 +47,7 @@ class Openapi {
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
Expand Down
@@ -1,6 +1,6 @@
library openapi.api;

import 'package:http/io_client.dart';
import 'package:http/http.dart' as http;
import 'package:jaguar_serializer/jaguar_serializer.dart';
import 'package:jaguar_serializer_protobuf/proto_repo.dart';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
Expand Down Expand Up @@ -57,7 +57,7 @@ class Openapi {
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
Expand Down