forked from loafle/openapi-generator-original
add flutter web support on jaguar dart (#3786)
This commit is contained in:
parent
44d8b49dee
commit
c2f786b8ad
@ -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';
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user