[Dart][Jaguar] and proto serialization support (#1793)
* add proto format support for jaguar generator * Add openApiType to CodegenProperties Finish proto generation
@ -35,6 +35,14 @@ java $JAVA_OPTS -jar $executable $ags
|
|||||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_petstore/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
|
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_petstore/openapi -DhideGenerationTimestamp=true -DpubName=openapi"
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
# Generate proto and put it to the flutter sample app
|
||||||
|
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi -Dserialization=proto -DhideGenerationTimestamp=true -DpubName=openapi"
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
# Generate proto and put it to the sample
|
||||||
|
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/openapi_proto -Dserialization=proto -DhideGenerationTimestamp=true -DpubName=openapi"
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
# There is a proposal to allow importing different libraries depending on the environment:
|
# There is a proposal to allow importing different libraries depending on the environment:
|
||||||
# https://github.com/munificent/dep-interface-libraries
|
# https://github.com/munificent/dep-interface-libraries
|
||||||
# When this is implemented there will only be one library.
|
# When this is implemented there will only be one library.
|
||||||
|
@ -1,21 +1,43 @@
|
|||||||
|
|
||||||
---
|
CONFIG OPTIONS for dart-jaguar
|
||||||
id: generator-opts-client-dart-jaguar
|
|
||||||
title: Config Options for dart-jaguar
|
|
||||||
sidebar_label: dart-jaguar
|
|
||||||
---
|
|
||||||
|
|
||||||
| Option | Description | Values | Default |
|
sortParamsByRequiredFlag
|
||||||
| ------ | ----------- | ------ | ------- |
|
Sort method arguments to place required parameters before optional parameters. (Default: true)
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
|
||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
ensureUniqueParams
|
||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|
||||||
|browserClient|Is the client browser based| |null|
|
allowUnicodeIdentifiers
|
||||||
|pubName|Name in generated pubspec| |null|
|
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)
|
||||||
|pubVersion|Version in generated pubspec| |null|
|
|
||||||
|pubDescription|Description in generated pubspec| |null|
|
prependFormOrBodyParameters
|
||||||
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null|
|
Add form or body parameters to the beginning of the parameter list. (Default: false)
|
||||||
|sourceFolder|source folder for generated code| |null|
|
|
||||||
|supportDart2|support dart2| |true|
|
browserClient
|
||||||
|nullableFields|Is the null fields should be in the JSON payload| |null|
|
Is the client browser based
|
||||||
|
|
||||||
|
pubName
|
||||||
|
Name in generated pubspec
|
||||||
|
|
||||||
|
pubVersion
|
||||||
|
Version in generated pubspec
|
||||||
|
|
||||||
|
pubDescription
|
||||||
|
Description in generated pubspec
|
||||||
|
|
||||||
|
useEnumExtension
|
||||||
|
Allow the 'x-enum-values' extension for enums
|
||||||
|
|
||||||
|
sourceFolder
|
||||||
|
source folder for generated code
|
||||||
|
|
||||||
|
supportDart2
|
||||||
|
support dart2 (Default: true)
|
||||||
|
|
||||||
|
nullableFields
|
||||||
|
Is the null fields should be in the JSON payload
|
||||||
|
|
||||||
|
serialization
|
||||||
|
Choose serialization format JSON or PROTO is supported
|
||||||
|
|
||||||
|
Back to the [generators list](README.md)
|
||||||
|
@ -20,7 +20,7 @@ package org.openapitools.codegen;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class CodegenProperty implements Cloneable {
|
public class CodegenProperty implements Cloneable {
|
||||||
public String baseName, complexType, getter, setter, description, dataType,
|
public String openApiType, baseName, complexType, getter, setter, description, dataType,
|
||||||
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam,
|
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam,
|
||||||
baseType, containerType, title;
|
baseType, containerType, title;
|
||||||
|
|
||||||
@ -415,6 +415,7 @@ public class CodegenProperty implements Cloneable {
|
|||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
_enum,
|
_enum,
|
||||||
allowableValues,
|
allowableValues,
|
||||||
|
openApiType,
|
||||||
baseName,
|
baseName,
|
||||||
baseType,
|
baseType,
|
||||||
complexType,
|
complexType,
|
||||||
@ -501,6 +502,7 @@ public class CodegenProperty implements Cloneable {
|
|||||||
final CodegenProperty other = (CodegenProperty) obj;
|
final CodegenProperty other = (CodegenProperty) obj;
|
||||||
|
|
||||||
return Objects.equals(baseName, other.baseName) &&
|
return Objects.equals(baseName, other.baseName) &&
|
||||||
|
Objects.equals(openApiType, other.openApiType) &&
|
||||||
Objects.equals(complexType, other.complexType) &&
|
Objects.equals(complexType, other.complexType) &&
|
||||||
Objects.equals(getter, other.getter) &&
|
Objects.equals(getter, other.getter) &&
|
||||||
Objects.equals(setter, other.setter) &&
|
Objects.equals(setter, other.setter) &&
|
||||||
@ -600,6 +602,7 @@ public class CodegenProperty implements Cloneable {
|
|||||||
public java.lang.String toString() {
|
public java.lang.String toString() {
|
||||||
return "CodegenProperty{" +
|
return "CodegenProperty{" +
|
||||||
"baseName='" + baseName + '\'' +
|
"baseName='" + baseName + '\'' +
|
||||||
|
", openApiType='" + openApiType + '\'' +
|
||||||
", complexType='" + complexType + '\'' +
|
", complexType='" + complexType + '\'' +
|
||||||
", getter='" + getter + '\'' +
|
", getter='" + getter + '\'' +
|
||||||
", setter='" + setter + '\'' +
|
", setter='" + setter + '\'' +
|
||||||
|
@ -1900,6 +1900,11 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
|
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
|
||||||
property.name = toVarName(name);
|
property.name = toVarName(name);
|
||||||
property.baseName = name;
|
property.baseName = name;
|
||||||
|
if (p.getType() == null) {
|
||||||
|
property.openApiType = getSchemaType(p);
|
||||||
|
} else {
|
||||||
|
property.openApiType = p.getType();
|
||||||
|
}
|
||||||
property.nameInCamelCase = camelize(property.name, false);
|
property.nameInCamelCase = camelize(property.name, false);
|
||||||
property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase);
|
property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase);
|
||||||
property.description = escapeText(p.getDescription());
|
property.description = escapeText(p.getDescription());
|
||||||
|
@ -16,10 +16,16 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
import org.openapitools.codegen.*;
|
||||||
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.media.*;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
|
import org.openapitools.codegen.utils.ProcessUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -28,16 +34,25 @@ import static org.openapitools.codegen.utils.StringUtils.underscore;
|
|||||||
|
|
||||||
public class DartJaguarClientCodegen extends DartClientCodegen {
|
public class DartJaguarClientCodegen extends DartClientCodegen {
|
||||||
private static final String NULLABLE_FIELDS = "nullableFields";
|
private static final String NULLABLE_FIELDS = "nullableFields";
|
||||||
|
private static final String SERIALIZATION_FORMAT = "serialization";
|
||||||
|
private static final String IS_FORMAT_JSON = "jsonFormat";
|
||||||
|
private static final String IS_FORMAT_PROTO = "protoFormat";
|
||||||
private static Set<String> modelToIgnore = new HashSet<>();
|
private static Set<String> modelToIgnore = new HashSet<>();
|
||||||
|
private HashMap<String, String> protoTypeMapping = new HashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
modelToIgnore.add("datetime");
|
modelToIgnore.add("datetime");
|
||||||
modelToIgnore.add("map");
|
modelToIgnore.add("map");
|
||||||
modelToIgnore.add("list");
|
modelToIgnore.add("list");
|
||||||
modelToIgnore.add("file");
|
modelToIgnore.add("file");
|
||||||
|
modelToIgnore.add("uint8list");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String SERIALIZATION_JSON = "json";
|
||||||
|
private static final String SERIALIZATION_PROTO = "proto";
|
||||||
|
|
||||||
private boolean nullableFields = true;
|
private boolean nullableFields = true;
|
||||||
|
private String serialization = SERIALIZATION_JSON;
|
||||||
|
|
||||||
public DartJaguarClientCodegen() {
|
public DartJaguarClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -46,6 +61,33 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
embeddedTemplateDir = templateDir = "dart-jaguar";
|
embeddedTemplateDir = templateDir = "dart-jaguar";
|
||||||
|
|
||||||
cliOptions.add(new CliOption(NULLABLE_FIELDS, "Is the null fields should be in the JSON payload"));
|
cliOptions.add(new CliOption(NULLABLE_FIELDS, "Is the null fields should be in the JSON payload"));
|
||||||
|
cliOptions.add(new CliOption(SERIALIZATION_FORMAT, "Choose serialization format JSON or PROTO is supported"));
|
||||||
|
|
||||||
|
typeMapping.put("file", "Uint8List");
|
||||||
|
typeMapping.put("binary", "Uint8List");
|
||||||
|
|
||||||
|
protoTypeMapping.put("Array", "repeated");
|
||||||
|
protoTypeMapping.put("array", "repeated");
|
||||||
|
protoTypeMapping.put("List", "repeated");
|
||||||
|
protoTypeMapping.put("boolean", "bool");
|
||||||
|
protoTypeMapping.put("string", "string");
|
||||||
|
protoTypeMapping.put("char", "string");
|
||||||
|
protoTypeMapping.put("int", "int32");
|
||||||
|
protoTypeMapping.put("long", "int64");
|
||||||
|
protoTypeMapping.put("short", "int32");
|
||||||
|
protoTypeMapping.put("number", "double");
|
||||||
|
protoTypeMapping.put("float", "float");
|
||||||
|
protoTypeMapping.put("double", "double");
|
||||||
|
protoTypeMapping.put("object", "google.protobuf.Any");
|
||||||
|
protoTypeMapping.put("integer", "int32");
|
||||||
|
protoTypeMapping.put("Date", "google.protobuf.Timestamp");
|
||||||
|
protoTypeMapping.put("date", "google.protobuf.Timestamp");
|
||||||
|
protoTypeMapping.put("File", "bytes");
|
||||||
|
protoTypeMapping.put("file", "bytes");
|
||||||
|
protoTypeMapping.put("binary", "bytes");
|
||||||
|
protoTypeMapping.put("UUID", "string");
|
||||||
|
protoTypeMapping.put("ByteArray", "bytes");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +119,20 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
additionalProperties.put(NULLABLE_FIELDS, nullableFields);
|
additionalProperties.put(NULLABLE_FIELDS, nullableFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(SERIALIZATION_FORMAT)) {
|
||||||
|
serialization = ((String) additionalProperties.get(SERIALIZATION_FORMAT));
|
||||||
|
boolean isProto = serialization.equalsIgnoreCase(SERIALIZATION_PROTO);
|
||||||
|
additionalProperties.put(IS_FORMAT_JSON, serialization.equalsIgnoreCase(SERIALIZATION_JSON));
|
||||||
|
additionalProperties.put(IS_FORMAT_PROTO, isProto);
|
||||||
|
|
||||||
|
modelTemplateFiles.put("model.mustache", isProto ? ".proto" : ".dart");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//not set, use to be passed to template
|
||||||
|
additionalProperties.put(IS_FORMAT_JSON, true);
|
||||||
|
additionalProperties.put(IS_FORMAT_PROTO, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (additionalProperties.containsKey(PUB_NAME)) {
|
if (additionalProperties.containsKey(PUB_NAME)) {
|
||||||
this.setPubName((String) additionalProperties.get(PUB_NAME));
|
this.setPubName((String) additionalProperties.get(PUB_NAME));
|
||||||
} else {
|
} else {
|
||||||
@ -133,6 +189,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
||||||
objs = super.postProcessModels(objs);
|
objs = super.postProcessModels(objs);
|
||||||
List<Object> models = (List<Object>) objs.get("models");
|
List<Object> models = (List<Object>) objs.get("models");
|
||||||
|
ProcessUtils.addIndexToProperties(models, 1);
|
||||||
for (Object _mo : models) {
|
for (Object _mo : models) {
|
||||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||||
Set<String> modelImports = new HashSet<>();
|
Set<String> modelImports = new HashSet<>();
|
||||||
@ -142,6 +199,16 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
modelImports.add(underscore(modelImport));
|
modelImports.add(underscore(modelImport));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (CodegenProperty p : cm.vars) {
|
||||||
|
String protoType = protoTypeMapping.get(p.openApiType);
|
||||||
|
if (p.isListContainer) {
|
||||||
|
String innerType = protoTypeMapping.get(p.mostInnerItems.openApiType);
|
||||||
|
protoType = protoType + " " + (innerType == null ? p.mostInnerItems.openApiType : innerType);
|
||||||
|
}
|
||||||
|
p.vendorExtensions.put("x-proto-type", protoType == null ? p.openApiType : protoType);
|
||||||
|
}
|
||||||
|
|
||||||
cm.imports = modelImports;
|
cm.imports = modelImports;
|
||||||
cm.vendorExtensions.put("hasVars", cm.vars.size() > 0);
|
cm.vendorExtensions.put("hasVars", cm.vars.size() > 0);
|
||||||
}
|
}
|
||||||
@ -155,17 +222,20 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||||
|
|
||||||
Set<String> modelImports = new HashSet<>();
|
Set<String> modelImports = new HashSet<>();
|
||||||
|
Set<String> fullImports = new HashSet<>();
|
||||||
|
|
||||||
for (CodegenOperation op : operationList) {
|
for (CodegenOperation op : operationList) {
|
||||||
op.httpMethod = StringUtils.capitalize(op.httpMethod.toLowerCase(Locale.ROOT));
|
op.httpMethod = StringUtils.capitalize(op.httpMethod.toLowerCase(Locale.ROOT));
|
||||||
boolean isJson = true; //default to JSON
|
boolean isJson = true; //default to JSON
|
||||||
boolean isForm = false;
|
boolean isForm = false;
|
||||||
|
boolean isProto = false;
|
||||||
boolean isMultipart = false;
|
boolean isMultipart = false;
|
||||||
if (op.consumes != null) {
|
if (op.consumes != null) {
|
||||||
for (Map<String, String> consume : op.consumes) {
|
for (Map<String, String> consume : op.consumes) {
|
||||||
if (consume.containsKey("mediaType")) {
|
if (consume.containsKey("mediaType")) {
|
||||||
String type = consume.get("mediaType");
|
String type = consume.get("mediaType");
|
||||||
isJson = type.equalsIgnoreCase("application/json");
|
isJson = type.equalsIgnoreCase("application/json");
|
||||||
|
isProto = type.equalsIgnoreCase("application/octet-stream");
|
||||||
isForm = type.equalsIgnoreCase("application/x-www-form-urlencoded");
|
isForm = type.equalsIgnoreCase("application/x-www-form-urlencoded");
|
||||||
isMultipart = type.equalsIgnoreCase("multipart/form-data");
|
isMultipart = type.equalsIgnoreCase("multipart/form-data");
|
||||||
break;
|
break;
|
||||||
@ -173,7 +243,27 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (CodegenParameter param : op.allParams) {
|
||||||
|
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
|
||||||
|
param.baseType = "MultipartFile";
|
||||||
|
param.dataType = "MultipartFile";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (CodegenParameter param : op.formParams) {
|
||||||
|
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
|
||||||
|
param.baseType = "MultipartFile";
|
||||||
|
param.dataType = "MultipartFile";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (CodegenParameter param : op.bodyParams) {
|
||||||
|
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
|
||||||
|
param.baseType = "MultipartFile";
|
||||||
|
param.dataType = "MultipartFile";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
op.vendorExtensions.put("isJson", isJson);
|
op.vendorExtensions.put("isJson", isJson);
|
||||||
|
op.vendorExtensions.put("isProto", isProto);
|
||||||
op.vendorExtensions.put("isForm", isForm);
|
op.vendorExtensions.put("isForm", isForm);
|
||||||
op.vendorExtensions.put("isMultipart", isMultipart);
|
op.vendorExtensions.put("isMultipart", isMultipart);
|
||||||
|
|
||||||
@ -181,6 +271,8 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
for (String item : op.imports) {
|
for (String item : op.imports) {
|
||||||
if (!modelToIgnore.contains(item.toLowerCase(Locale.ROOT))) {
|
if (!modelToIgnore.contains(item.toLowerCase(Locale.ROOT))) {
|
||||||
imports.add(underscore(item));
|
imports.add(underscore(item));
|
||||||
|
} else if (item.equalsIgnoreCase("Uint8List")) {
|
||||||
|
fullImports.add("dart:typed_data");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modelImports.addAll(imports);
|
modelImports.addAll(imports);
|
||||||
@ -205,6 +297,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
objs.put("modelImports", modelImports);
|
objs.put("modelImports", modelImports);
|
||||||
|
objs.put("fullImports", fullImports);
|
||||||
|
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
@ -14,19 +14,20 @@ public class ProcessUtils {
|
|||||||
* Add x-index extension to the model's properties
|
* Add x-index extension to the model's properties
|
||||||
*
|
*
|
||||||
* @param models List of models
|
* @param models List of models
|
||||||
|
* @param initialIndex starting index to use
|
||||||
*/
|
*/
|
||||||
public static void addIndexToProperties(List<Object> models) {
|
public static void addIndexToProperties(List<Object> models, int initialIndex) {
|
||||||
for (Object _mo : models) {
|
for (Object _mo : models) {
|
||||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
|
|
||||||
int i = 0;
|
int i = initialIndex;
|
||||||
for (CodegenProperty var : cm.vars) {
|
for (CodegenProperty var : cm.vars) {
|
||||||
var.vendorExtensions.put("x-index", i);
|
var.vendorExtensions.put("x-index", i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int j = 0;
|
int j = initialIndex;
|
||||||
for (CodegenProperty var : cm.allVars) {
|
for (CodegenProperty var : cm.allVars) {
|
||||||
var.vendorExtensions.put("x-index", j);
|
var.vendorExtensions.put("x-index", j);
|
||||||
j++;
|
j++;
|
||||||
@ -36,6 +37,15 @@ public class ProcessUtils {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add x-index extension to the model's properties
|
||||||
|
*
|
||||||
|
* @param models List of models
|
||||||
|
*/
|
||||||
|
public static void addIndexToProperties(List<Object> models) {
|
||||||
|
addIndexToProperties(models, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if at least one operation has OAuth security schema defined
|
* Returns true if at least one operation has OAuth security schema defined
|
||||||
*
|
*
|
||||||
|
@ -1,2 +1 @@
|
|||||||
analyzer:
|
analyzer:
|
||||||
strong-mode: true
|
|
@ -1,23 +1,24 @@
|
|||||||
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
||||||
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
import 'package:jaguar_serializer/src/repo/repo.dart';
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#modelImports}}import 'package:{{pubName}}/model/{{.}}.dart';
|
{{#modelImports}}import 'package:{{pubName}}/model/{{.}}{{#protoFormat}}.pb{{/protoFormat}}.dart';
|
||||||
{{/modelImports}}
|
{{/modelImports}}
|
||||||
|
{{#fullImports}}import '{{.}}';
|
||||||
|
{{/fullImports}}
|
||||||
|
|
||||||
part '{{classFilename}}.jretro.dart';
|
part '{{classFilename}}.jretro.dart';
|
||||||
|
|
||||||
@GenApiClient()
|
@GenApiClient()
|
||||||
class {{classname}} extends _${{classname}}Client implements ApiClient {
|
class {{classname}} extends ApiClient with _${{classname}}Client {
|
||||||
final Route base;
|
final Route base;
|
||||||
final SerializerRepo serializers;
|
final Map<String, CodecRepo> converters;
|
||||||
final Duration timeout;
|
final Duration timeout;
|
||||||
|
|
||||||
{{classname}}({this.base, this.serializers, this.timeout = const Duration(minutes: 2)});
|
{{classname}}({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
/// {{summary}}
|
/// {{summary}}
|
||||||
@ -43,7 +44,7 @@ class {{classname}} extends _${{classname}}Client implements ApiClient {
|
|||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
{{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}
|
{{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}
|
||||||
{{^isJson}}{{^isForm}}{{^isMultipart}}@AsBody(){{/isMultipart}}{{/isForm}}{{/isJson}} {{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsForm() {{/isForm}}{{#isMultipart}}@AsMultipart() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}
|
{{^isProto}}{{^isJson}}{{^isForm}}{{^isMultipart}}@AsBody(){{/isMultipart}}{{/isForm}}{{/isJson}}{{/isProto}} {{#isProto}}@Serialized(MimeTypes.binary) {{/isProto}}{{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsForm() {{/isForm}}{{#isMultipart}}@AsMultipart() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}
|
||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
{{/vendorExtensions}}
|
{{/vendorExtensions}}
|
||||||
) {
|
) {
|
||||||
|
@ -2,19 +2,43 @@ library {{pubName}}.api;
|
|||||||
|
|
||||||
import 'package:http/io_client.dart';
|
import 'package:http/io_client.dart';
|
||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
{{#protoFormat}}
|
||||||
|
import 'package:jaguar_serializer_protobuf/proto_repo.dart';
|
||||||
|
{{/protoFormat}}
|
||||||
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
||||||
import 'package:{{pubName}}/auth/api_key_auth.dart';
|
import 'package:{{pubName}}/auth/api_key_auth.dart';
|
||||||
import 'package:{{pubName}}/auth/basic_auth.dart';
|
import 'package:{{pubName}}/auth/basic_auth.dart';
|
||||||
import 'package:{{pubName}}/auth/oauth.dart';
|
import 'package:{{pubName}}/auth/oauth.dart';
|
||||||
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
|
|
||||||
{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart';
|
{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart';
|
||||||
{{/apis}}{{/apiInfo}}
|
{{/apis}}{{/apiInfo}}
|
||||||
{{#models}}{{#model}}import 'package:{{pubName}}/model/{{classFilename}}.dart';
|
{{#models}}{{#model}}import 'package:{{pubName}}/model/{{classFilename}}{{#protoFormat}}.pb{{/protoFormat}}.dart';
|
||||||
{{/model}}{{/models}}
|
{{/model}}{{/models}}
|
||||||
|
|
||||||
final jsonJaguarRepo = JsonRepo()
|
|
||||||
|
{{#jsonFormat}}
|
||||||
|
final _jsonJaguarRepo = JsonRepo()
|
||||||
{{#models}}{{#model}}..add({{classname}}Serializer())
|
{{#models}}{{#model}}..add({{classname}}Serializer())
|
||||||
{{/model}}{{/models}};
|
{{/model}}{{/models}};
|
||||||
|
final Map<String, CodecRepo> _converters = {
|
||||||
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
|
};
|
||||||
|
{{/jsonFormat}}
|
||||||
|
|
||||||
|
{{#protoFormat}}
|
||||||
|
final _protoJaguarRepo = ProtoCodecRepo()
|
||||||
|
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
|
||||||
|
{{/model}}{{/models}};
|
||||||
|
final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
|
||||||
|
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
|
||||||
|
{{/model}}{{/models}};
|
||||||
|
final Map<String, CodecRepo> _converters = {
|
||||||
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
|
MimeTypes.binary: _protoJaguarRepo,
|
||||||
|
};
|
||||||
|
{{/protoFormat}}
|
||||||
|
|
||||||
|
|
||||||
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
||||||
|
|
||||||
@ -62,14 +86,14 @@ class JaguarApiGen {
|
|||||||
* Get {{classname}} instance, base route and serializer can be overridden by a given but be careful,
|
* Get {{classname}} instance, base route and serializer can be overridden by a given but be careful,
|
||||||
* by doing that all interceptors will not be executed
|
* by doing that all interceptors will not be executed
|
||||||
*/
|
*/
|
||||||
{{classname}} get{{classname}}({Route base, SerializerRepo serializers}) {
|
{{classname}} get{{classname}}({Route base, Map<String, CodecRepo> converters}) {
|
||||||
if(base == null) {
|
if(base == null) {
|
||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(serializers == null) {
|
if(converters == null) {
|
||||||
serializers = jsonJaguarRepo;
|
converters = _converters;
|
||||||
}
|
}
|
||||||
return {{classname}}(base: base, serializers: serializers, timeout: timeout);
|
return {{classname}}(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/apis}}{{/apiInfo}}
|
{{/apis}}{{/apiInfo}}
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
|
{{#protoFormat}}
|
||||||
|
message {{classname}} {
|
||||||
|
{{#vars}}
|
||||||
|
{{#vendorExtensions}}{{{x-proto-type}}} {{name}} = {{x-index}}{{/vendorExtensions}};
|
||||||
|
{{/vars}}
|
||||||
|
}
|
||||||
|
{{/protoFormat}}
|
||||||
|
{{#jsonFormat}}
|
||||||
part '{{classFilename}}.jser.dart';
|
part '{{classFilename}}.jser.dart';
|
||||||
|
|
||||||
class {{classname}} {
|
class {{classname}} {
|
||||||
{{#vars}}{{#description}} /* {{{description}}} */{{/description}}
|
{{#vars}}{{#description}} /* {{{description}}} */{{/description}}
|
||||||
@Alias('{{baseName}}')
|
@Alias('{{{baseName}}}')
|
||||||
final {{{datatype}}} {{name}};
|
final {{{datatype}}} {{name}};
|
||||||
{{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}}{{/vars}}
|
{{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}}{{/vars}}
|
||||||
|
|
||||||
@ -25,3 +33,4 @@ class {{classname}} {
|
|||||||
class {{classname}}Serializer extends Serializer<{{classname}}> with _${{classname}}Serializer {
|
class {{classname}}Serializer extends Serializer<{{classname}}> with _${{classname}}Serializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
{{/jsonFormat}}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
{{#jsonFormat}}import 'package:jaguar_serializer/jaguar_serializer.dart';{{/jsonFormat}}
|
||||||
|
{{#protoFormat}}syntax = "proto3";{{/protoFormat}}
|
||||||
|
|
||||||
{{#models}}
|
{{#models}}
|
||||||
{{#model}}
|
{{#model}}
|
||||||
{{#imports}}import 'package:{{pubName}}/model/{{.}}.dart';
|
{{#imports}}
|
||||||
|
{{#jsonFormat}}import 'package:{{pubName}}/model/{{.}}.dart';{{/jsonFormat}}
|
||||||
|
{{#protoFormat}}import "{{.}}.proto";{{/protoFormat}}
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}}
|
{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}}
|
||||||
{{/model}}
|
{{/model}}
|
||||||
|
@ -4,9 +4,17 @@ description: {{pubDescription}}
|
|||||||
environment:
|
environment:
|
||||||
sdk: ">=2.0.0 <3.0.0"
|
sdk: ">=2.0.0 <3.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
jaguar_retrofit: '^2.5.12'
|
jaguar_retrofit: '^2.8.2'
|
||||||
jaguar_serializer: '^2.2.4'
|
{{#jsonFormat}}
|
||||||
|
jaguar_serializer: '^2.2.6'
|
||||||
|
{{/jsonFormat}}
|
||||||
|
{{#protoFormat}}
|
||||||
|
jaguar_serializer_protobuf: '^2.2.2'
|
||||||
|
jaguar_mimetype: '^1.0.1'
|
||||||
|
{{/protoFormat}}
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
jaguar_retrofit_gen: '^2.5.10'
|
jaguar_retrofit_gen: '^2.8.5'
|
||||||
jaguar_serializer_cli: '^2.2.4'
|
{{#jsonFormat}}
|
||||||
|
jaguar_serializer_cli: '^2.2.5'
|
||||||
|
{{/jsonFormat}}
|
||||||
build_runner: '^1.1.1'
|
build_runner: '^1.1.1'
|
@ -0,0 +1,699 @@
|
|||||||
|
swagger: '2.0'
|
||||||
|
info:
|
||||||
|
description: 'This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.'
|
||||||
|
version: 1.0.0
|
||||||
|
title: OpenAPI Petstore
|
||||||
|
license:
|
||||||
|
name: Apache-2.0
|
||||||
|
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
||||||
|
host: petstore.swagger.io
|
||||||
|
basePath: /v2
|
||||||
|
consumes:
|
||||||
|
- application/octet-stream
|
||||||
|
produces:
|
||||||
|
- application/octet-stream
|
||||||
|
tags:
|
||||||
|
- name: pet
|
||||||
|
description: Everything about your Pets
|
||||||
|
- name: store
|
||||||
|
description: Access to Petstore orders
|
||||||
|
- name: user
|
||||||
|
description: Operations about user
|
||||||
|
schemes:
|
||||||
|
- http
|
||||||
|
paths:
|
||||||
|
/pet:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Add a new pet to the store
|
||||||
|
description: ''
|
||||||
|
operationId: addPet
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
- application/xml
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: Pet object that needs to be added to the store
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Pet'
|
||||||
|
responses:
|
||||||
|
'405':
|
||||||
|
description: Invalid input
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Update an existing pet
|
||||||
|
description: ''
|
||||||
|
operationId: updatePet
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
- application/xml
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: Pet object that needs to be added to the store
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Pet'
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Pet not found
|
||||||
|
'405':
|
||||||
|
description: Validation exception
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
/pet/findByStatus:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Finds Pets by status
|
||||||
|
description: Multiple status values can be provided with comma separated strings
|
||||||
|
operationId: findPetsByStatus
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: status
|
||||||
|
in: query
|
||||||
|
description: Status values that need to be considered for filter
|
||||||
|
required: true
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- available
|
||||||
|
- pending
|
||||||
|
- sold
|
||||||
|
default: available
|
||||||
|
collectionFormat: csv
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/Pet'
|
||||||
|
'400':
|
||||||
|
description: Invalid status value
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
/pet/findByTags:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Finds Pets by tags
|
||||||
|
description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.'
|
||||||
|
operationId: findPetsByTags
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: tags
|
||||||
|
in: query
|
||||||
|
description: Tags to filter by
|
||||||
|
required: true
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
collectionFormat: csv
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/Pet'
|
||||||
|
'400':
|
||||||
|
description: Invalid tag value
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
deprecated: true
|
||||||
|
'/pet/{petId}':
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Find pet by ID
|
||||||
|
description: Returns a single pet
|
||||||
|
operationId: getPetById
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to return
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Pet'
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Pet not found
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Updates a pet in the store with form data
|
||||||
|
description: ''
|
||||||
|
operationId: updatePetWithForm
|
||||||
|
consumes:
|
||||||
|
- application/x-www-form-urlencoded
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet that needs to be updated
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
- name: name
|
||||||
|
in: formData
|
||||||
|
description: Updated name of the pet
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
- name: status
|
||||||
|
in: formData
|
||||||
|
description: Updated status of the pet
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'405':
|
||||||
|
description: Invalid input
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Deletes a pet
|
||||||
|
description: ''
|
||||||
|
operationId: deletePet
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: api_key
|
||||||
|
in: header
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: Pet id to delete
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid pet value
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
'/pet/{petId}/uploadImage':
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: uploads an image
|
||||||
|
description: ''
|
||||||
|
operationId: uploadFile
|
||||||
|
consumes:
|
||||||
|
- multipart/form-data
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to update
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
- name: additionalMetadata
|
||||||
|
in: formData
|
||||||
|
description: Additional data to pass to server
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
- name: file
|
||||||
|
in: formData
|
||||||
|
description: file to upload
|
||||||
|
required: false
|
||||||
|
type: file
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/ApiResponse'
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
/store/inventory:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Returns pet inventories by status
|
||||||
|
description: Returns a map of status codes to quantities
|
||||||
|
operationId: getInventory
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
parameters: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
/store/order:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Place an order for a pet
|
||||||
|
description: ''
|
||||||
|
operationId: placeOrder
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: order placed for purchasing the pet
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Order'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Order'
|
||||||
|
'400':
|
||||||
|
description: Invalid Order
|
||||||
|
'/store/order/{orderId}':
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Find purchase order by ID
|
||||||
|
description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions'
|
||||||
|
operationId: getOrderById
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: orderId
|
||||||
|
in: path
|
||||||
|
description: ID of pet that needs to be fetched
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
maximum: 5
|
||||||
|
minimum: 1
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Order'
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Order not found
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Delete purchase order by ID
|
||||||
|
description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
operationId: deleteOrder
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: orderId
|
||||||
|
in: path
|
||||||
|
description: ID of the order that needs to be deleted
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Order not found
|
||||||
|
/user:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Create user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: createUser
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: Created user object
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/User'
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
/user/createWithArray:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Creates list of users with given input array
|
||||||
|
description: ''
|
||||||
|
operationId: createUsersWithArrayInput
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: List of user object
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/User'
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
/user/createWithList:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Creates list of users with given input array
|
||||||
|
description: ''
|
||||||
|
operationId: createUsersWithListInput
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: List of user object
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/User'
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
/user/login:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Logs user into the system
|
||||||
|
description: ''
|
||||||
|
operationId: loginUser
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: query
|
||||||
|
description: The user name for login
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- name: password
|
||||||
|
in: query
|
||||||
|
description: The password for login in clear text
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
headers:
|
||||||
|
X-Rate-Limit:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
description: calls per hour allowed by the user
|
||||||
|
X-Expires-After:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
description: date in UTC when toekn expires
|
||||||
|
'400':
|
||||||
|
description: Invalid username/password supplied
|
||||||
|
/user/logout:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Logs out current logged in user session
|
||||||
|
description: ''
|
||||||
|
operationId: logoutUser
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters: []
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
'/user/{username}':
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Get user by user name
|
||||||
|
description: ''
|
||||||
|
operationId: getUserByName
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: 'The name that needs to be fetched. Use user1 for testing.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/User'
|
||||||
|
'400':
|
||||||
|
description: Invalid username supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Updated user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: updateUser
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: name that need to be deleted
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
description: Updated user object
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/User'
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid user supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Delete user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: deleteUser
|
||||||
|
produces:
|
||||||
|
- application/xml
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: The name that needs to be deleted
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid username supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
securityDefinitions:
|
||||||
|
petstore_auth:
|
||||||
|
type: oauth2
|
||||||
|
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
|
||||||
|
flow: implicit
|
||||||
|
scopes:
|
||||||
|
'write:pets': modify pets in your account
|
||||||
|
'read:pets': read your pets
|
||||||
|
api_key:
|
||||||
|
type: apiKey
|
||||||
|
name: api_key
|
||||||
|
in: header
|
||||||
|
definitions:
|
||||||
|
Order:
|
||||||
|
title: Pet Order
|
||||||
|
description: An order for a pets from the pet store
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
petId:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
quantity:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
shipDate:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
description: Order Status
|
||||||
|
enum:
|
||||||
|
- placed
|
||||||
|
- approved
|
||||||
|
- delivered
|
||||||
|
complete:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
xml:
|
||||||
|
name: Order
|
||||||
|
Category:
|
||||||
|
title: Pet category
|
||||||
|
description: A category for a pet
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
xml:
|
||||||
|
name: Category
|
||||||
|
User:
|
||||||
|
title: a User
|
||||||
|
description: A User who is purchasing from the pet store
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
firstName:
|
||||||
|
type: string
|
||||||
|
lastName:
|
||||||
|
type: string
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
phone:
|
||||||
|
type: string
|
||||||
|
userStatus:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
description: User Status
|
||||||
|
xml:
|
||||||
|
name: User
|
||||||
|
Tag:
|
||||||
|
title: Pet Tag
|
||||||
|
description: A tag for a pet
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
xml:
|
||||||
|
name: Tag
|
||||||
|
Pet:
|
||||||
|
title: a Pet
|
||||||
|
description: A pet for sale in the pet store
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- photoUrls
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
category:
|
||||||
|
$ref: '#/definitions/Category'
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
example: doggie
|
||||||
|
photoUrls:
|
||||||
|
type: array
|
||||||
|
xml:
|
||||||
|
name: photoUrl
|
||||||
|
wrapped: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
type: array
|
||||||
|
xml:
|
||||||
|
name: tag
|
||||||
|
wrapped: true
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/Tag'
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
description: pet status in the store
|
||||||
|
enum:
|
||||||
|
- available
|
||||||
|
- pending
|
||||||
|
- sold
|
||||||
|
xml:
|
||||||
|
name: Pet
|
||||||
|
ApiResponse:
|
||||||
|
title: An uploaded response
|
||||||
|
description: Describes the result of uploading an image resource
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
message:
|
||||||
|
type: string
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/io_client.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
import 'package:openapi/model/order.dart';
|
import 'package:openapi/model/order.dart';
|
||||||
import 'package:openapi/model/pet.dart';
|
import 'package:openapi/model/pet.dart';
|
||||||
|
@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
|
|||||||
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2019-02-26T17:35:06.224333+01:00[Europe/Vienna]
|
- Build date: 2019-03-01T12:01:27.554664+01:00[Europe/Paris]
|
||||||
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -1,2 +1 @@
|
|||||||
analyzer:
|
analyzer:
|
||||||
strong-mode: true
|
|
@ -6,6 +6,7 @@ import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
|||||||
import 'package:openapi/auth/api_key_auth.dart';
|
import 'package:openapi/auth/api_key_auth.dart';
|
||||||
import 'package:openapi/auth/basic_auth.dart';
|
import 'package:openapi/auth/basic_auth.dart';
|
||||||
import 'package:openapi/auth/oauth.dart';
|
import 'package:openapi/auth/oauth.dart';
|
||||||
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
|
|
||||||
import 'package:openapi/api/pet_api.dart';
|
import 'package:openapi/api/pet_api.dart';
|
||||||
import 'package:openapi/api/store_api.dart';
|
import 'package:openapi/api/store_api.dart';
|
||||||
@ -19,7 +20,8 @@ import 'package:openapi/model/tag.dart';
|
|||||||
import 'package:openapi/model/user.dart';
|
import 'package:openapi/model/user.dart';
|
||||||
|
|
||||||
|
|
||||||
final jsonJaguarRepo = JsonRepo()
|
|
||||||
|
final _jsonJaguarRepo = JsonRepo()
|
||||||
..add(ApiResponseSerializer())
|
..add(ApiResponseSerializer())
|
||||||
..add(CategorySerializer())
|
..add(CategorySerializer())
|
||||||
..add(OrderSerializer())
|
..add(OrderSerializer())
|
||||||
@ -27,6 +29,11 @@ final jsonJaguarRepo = JsonRepo()
|
|||||||
..add(TagSerializer())
|
..add(TagSerializer())
|
||||||
..add(UserSerializer())
|
..add(UserSerializer())
|
||||||
;
|
;
|
||||||
|
final Map<String, CodecRepo> _converters = {
|
||||||
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
||||||
|
|
||||||
@ -74,14 +81,14 @@ class JaguarApiGen {
|
|||||||
* Get PetApi instance, base route and serializer can be overridden by a given but be careful,
|
* Get PetApi instance, base route and serializer can be overridden by a given but be careful,
|
||||||
* by doing that all interceptors will not be executed
|
* by doing that all interceptors will not be executed
|
||||||
*/
|
*/
|
||||||
PetApi getPetApi({Route base, SerializerRepo serializers}) {
|
PetApi getPetApi({Route base, Map<String, CodecRepo> converters}) {
|
||||||
if(base == null) {
|
if(base == null) {
|
||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(serializers == null) {
|
if(converters == null) {
|
||||||
serializers = jsonJaguarRepo;
|
converters = _converters;
|
||||||
}
|
}
|
||||||
return PetApi(base: base, serializers: serializers, timeout: timeout);
|
return PetApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -89,14 +96,14 @@ class JaguarApiGen {
|
|||||||
* Get StoreApi instance, base route and serializer can be overridden by a given but be careful,
|
* Get StoreApi instance, base route and serializer can be overridden by a given but be careful,
|
||||||
* by doing that all interceptors will not be executed
|
* by doing that all interceptors will not be executed
|
||||||
*/
|
*/
|
||||||
StoreApi getStoreApi({Route base, SerializerRepo serializers}) {
|
StoreApi getStoreApi({Route base, Map<String, CodecRepo> converters}) {
|
||||||
if(base == null) {
|
if(base == null) {
|
||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(serializers == null) {
|
if(converters == null) {
|
||||||
serializers = jsonJaguarRepo;
|
converters = _converters;
|
||||||
}
|
}
|
||||||
return StoreApi(base: base, serializers: serializers, timeout: timeout);
|
return StoreApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -104,14 +111,14 @@ class JaguarApiGen {
|
|||||||
* Get UserApi instance, base route and serializer can be overridden by a given but be careful,
|
* Get UserApi instance, base route and serializer can be overridden by a given but be careful,
|
||||||
* by doing that all interceptors will not be executed
|
* by doing that all interceptors will not be executed
|
||||||
*/
|
*/
|
||||||
UserApi getUserApi({Route base, SerializerRepo serializers}) {
|
UserApi getUserApi({Route base, Map<String, CodecRepo> converters}) {
|
||||||
if(base == null) {
|
if(base == null) {
|
||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(serializers == null) {
|
if(converters == null) {
|
||||||
serializers = jsonJaguarRepo;
|
converters = _converters;
|
||||||
}
|
}
|
||||||
return UserApi(base: base, serializers: serializers, timeout: timeout);
|
return UserApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
||||||
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
import 'package:jaguar_serializer/src/repo/repo.dart';
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:openapi/model/pet.dart';
|
import 'package:openapi/model/pet.dart';
|
||||||
import 'package:openapi/model/api_response.dart';
|
import 'package:openapi/model/api_response.dart';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
part 'pet_api.jretro.dart';
|
part 'pet_api.jretro.dart';
|
||||||
|
|
||||||
@GenApiClient()
|
@GenApiClient()
|
||||||
class PetApi extends _$PetApiClient implements ApiClient {
|
class PetApi extends ApiClient with _$PetApiClient {
|
||||||
final Route base;
|
final Route base;
|
||||||
final SerializerRepo serializers;
|
final Map<String, CodecRepo> converters;
|
||||||
final Duration timeout;
|
final Duration timeout;
|
||||||
|
|
||||||
PetApi({this.base, this.serializers, this.timeout = const Duration(minutes: 2)});
|
PetApi({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
|
||||||
|
|
||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
///
|
///
|
||||||
|
@ -8,7 +8,7 @@ part of 'pet_api.dart';
|
|||||||
|
|
||||||
abstract class _$PetApiClient implements ApiClient {
|
abstract class _$PetApiClient implements ApiClient {
|
||||||
final String basePath = "";
|
final String basePath = "";
|
||||||
Future<void> addPet(Pet pet) async {
|
Future<void> addPet(Pet body) async {
|
||||||
var req = base.post
|
var req = base.post
|
||||||
.metadata({
|
.metadata({
|
||||||
"auth": [
|
"auth": [
|
||||||
@ -20,8 +20,8 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
})
|
})
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/pet")
|
.path("/pet")
|
||||||
.json(serializers.to(pet));
|
.json(jsonConverter.to(body));
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deletePet(int petId, String apiKey) async {
|
Future<void> deletePet(int petId, String apiKey) async {
|
||||||
@ -38,7 +38,7 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.path("/pet/:petId")
|
.path("/pet/:petId")
|
||||||
.pathParams("petId", petId)
|
.pathParams("petId", petId)
|
||||||
.header("api_key", apiKey);
|
.header("api_key", apiKey);
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Pet>> findPetsByStatus(List<String> status) async {
|
Future<List<Pet>> findPetsByStatus(List<String> status) async {
|
||||||
@ -54,7 +54,7 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/pet/findByStatus")
|
.path("/pet/findByStatus")
|
||||||
.query("status", status);
|
.query("status", status);
|
||||||
return req.list(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Pet>> findPetsByTags(List<String> tags) async {
|
Future<List<Pet>> findPetsByTags(List<String> tags) async {
|
||||||
@ -70,7 +70,7 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/pet/findByTags")
|
.path("/pet/findByTags")
|
||||||
.query("tags", tags);
|
.query("tags", tags);
|
||||||
return req.list(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Pet> getPetById(int petId) async {
|
Future<Pet> getPetById(int petId) async {
|
||||||
@ -88,10 +88,10 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/pet/:petId")
|
.path("/pet/:petId")
|
||||||
.pathParams("petId", petId);
|
.pathParams("petId", petId);
|
||||||
return req.one(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updatePet(Pet pet) async {
|
Future<void> updatePet(Pet body) async {
|
||||||
var req = base.put
|
var req = base.put
|
||||||
.metadata({
|
.metadata({
|
||||||
"auth": [
|
"auth": [
|
||||||
@ -103,8 +103,8 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
})
|
})
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/pet")
|
.path("/pet")
|
||||||
.json(serializers.to(pet));
|
.json(jsonConverter.to(body));
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updatePetWithForm(int petId, String name, String status) async {
|
Future<void> updatePetWithForm(int petId, String name, String status) async {
|
||||||
@ -122,7 +122,7 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.pathParams("petId", petId)
|
.pathParams("petId", petId)
|
||||||
.urlEncodedFormField(name, name)
|
.urlEncodedFormField(name, name)
|
||||||
.urlEncodedFormField(status, status);
|
.urlEncodedFormField(status, status);
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ApiResponse> uploadFile(
|
Future<ApiResponse> uploadFile(
|
||||||
@ -141,6 +141,6 @@ abstract class _$PetApiClient implements ApiClient {
|
|||||||
.pathParams("petId", petId)
|
.pathParams("petId", petId)
|
||||||
.multipart({"additionalMetadata": additionalMetadata})
|
.multipart({"additionalMetadata": additionalMetadata})
|
||||||
.multipart({"file": file});
|
.multipart({"file": file});
|
||||||
return req.one(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
||||||
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
import 'package:jaguar_serializer/src/repo/repo.dart';
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:openapi/model/order.dart';
|
import 'package:openapi/model/order.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'store_api.jretro.dart';
|
part 'store_api.jretro.dart';
|
||||||
|
|
||||||
@GenApiClient()
|
@GenApiClient()
|
||||||
class StoreApi extends _$StoreApiClient implements ApiClient {
|
class StoreApi extends ApiClient with _$StoreApiClient {
|
||||||
final Route base;
|
final Route base;
|
||||||
final SerializerRepo serializers;
|
final Map<String, CodecRepo> converters;
|
||||||
final Duration timeout;
|
final Duration timeout;
|
||||||
|
|
||||||
StoreApi({this.base, this.serializers, this.timeout = const Duration(minutes: 2)});
|
StoreApi({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
|
||||||
|
|
||||||
/// Delete purchase order by ID
|
/// Delete purchase order by ID
|
||||||
///
|
///
|
||||||
|
@ -13,7 +13,7 @@ abstract class _$StoreApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/store/order/:orderId")
|
.path("/store/order/:orderId")
|
||||||
.pathParams("orderId", orderId);
|
.pathParams("orderId", orderId);
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Map<String, int>> getInventory() async {
|
Future<Map<String, int>> getInventory() async {
|
||||||
@ -30,7 +30,7 @@ abstract class _$StoreApiClient implements ApiClient {
|
|||||||
})
|
})
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/store/inventory");
|
.path("/store/inventory");
|
||||||
return req.one().then((v) => serializers.mapFrom<int>(v));
|
return req.one().then((v) => jsonConverter.mapFrom<int>(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Order> getOrderById(int orderId) async {
|
Future<Order> getOrderById(int orderId) async {
|
||||||
@ -38,14 +38,14 @@ abstract class _$StoreApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/store/order/:orderId")
|
.path("/store/order/:orderId")
|
||||||
.pathParams("orderId", orderId);
|
.pathParams("orderId", orderId);
|
||||||
return req.one(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Order> placeOrder(Order order) async {
|
Future<Order> placeOrder(Order body) async {
|
||||||
var req = base.post
|
var req = base.post
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/store/order")
|
.path("/store/order")
|
||||||
.json(serializers.to(order));
|
.json(jsonConverter.to(body));
|
||||||
return req.one(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
import 'package:jaguar_retrofit/annotations/annotations.dart';
|
||||||
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
|
||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
import 'package:jaguar_serializer/src/repo/repo.dart';
|
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:openapi/model/user.dart';
|
import 'package:openapi/model/user.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'user_api.jretro.dart';
|
part 'user_api.jretro.dart';
|
||||||
|
|
||||||
@GenApiClient()
|
@GenApiClient()
|
||||||
class UserApi extends _$UserApiClient implements ApiClient {
|
class UserApi extends ApiClient with _$UserApiClient {
|
||||||
final Route base;
|
final Route base;
|
||||||
final SerializerRepo serializers;
|
final Map<String, CodecRepo> converters;
|
||||||
final Duration timeout;
|
final Duration timeout;
|
||||||
|
|
||||||
UserApi({this.base, this.serializers, this.timeout = const Duration(minutes: 2)});
|
UserApi({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
|
||||||
|
|
||||||
/// Create user
|
/// Create user
|
||||||
///
|
///
|
||||||
|
@ -8,25 +8,26 @@ part of 'user_api.dart';
|
|||||||
|
|
||||||
abstract class _$UserApiClient implements ApiClient {
|
abstract class _$UserApiClient implements ApiClient {
|
||||||
final String basePath = "";
|
final String basePath = "";
|
||||||
Future<void> createUser(User user) async {
|
Future<void> createUser(User body) async {
|
||||||
var req = base.post.path(basePath).path("/user").json(serializers.to(user));
|
var req =
|
||||||
await req.go();
|
base.post.path(basePath).path("/user").json(jsonConverter.to(body));
|
||||||
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> createUsersWithArrayInput(List<User> user) async {
|
Future<void> createUsersWithArrayInput(List<User> body) async {
|
||||||
var req = base.post
|
var req = base.post
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/user/createWithArray")
|
.path("/user/createWithArray")
|
||||||
.json(serializers.to(user));
|
.json(jsonConverter.to(body));
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> createUsersWithListInput(List<User> user) async {
|
Future<void> createUsersWithListInput(List<User> body) async {
|
||||||
var req = base.post
|
var req = base.post
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/user/createWithList")
|
.path("/user/createWithList")
|
||||||
.json(serializers.to(user));
|
.json(jsonConverter.to(body));
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteUser(String username) async {
|
Future<void> deleteUser(String username) async {
|
||||||
@ -34,7 +35,7 @@ abstract class _$UserApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/user/:username")
|
.path("/user/:username")
|
||||||
.pathParams("username", username);
|
.pathParams("username", username);
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<User> getUserByName(String username) async {
|
Future<User> getUserByName(String username) async {
|
||||||
@ -42,7 +43,7 @@ abstract class _$UserApiClient implements ApiClient {
|
|||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/user/:username")
|
.path("/user/:username")
|
||||||
.pathParams("username", username);
|
.pathParams("username", username);
|
||||||
return req.one(convert: serializers.oneFrom);
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> loginUser(String username, String password) async {
|
Future<String> loginUser(String username, String password) async {
|
||||||
@ -51,20 +52,20 @@ abstract class _$UserApiClient implements ApiClient {
|
|||||||
.path("/user/login")
|
.path("/user/login")
|
||||||
.query("username", username)
|
.query("username", username)
|
||||||
.query("password", password);
|
.query("password", password);
|
||||||
return req.one();
|
return req.go(throwOnErr: true).then(decodeOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> logoutUser() async {
|
Future<void> logoutUser() async {
|
||||||
var req = base.get.path(basePath).path("/user/logout");
|
var req = base.get.path(basePath).path("/user/logout");
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateUser(String username, User user) async {
|
Future<void> updateUser(String username, User body) async {
|
||||||
var req = base.put
|
var req = base.put
|
||||||
.path(basePath)
|
.path(basePath)
|
||||||
.path("/user/:username")
|
.path("/user/:username")
|
||||||
.pathParams("username", username)
|
.pathParams("username", username)
|
||||||
.json(serializers.to(user));
|
.json(jsonConverter.to(body));
|
||||||
await req.go();
|
await req.go(throwOnErr: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'api_response.jser.dart';
|
part 'api_response.jser.dart';
|
||||||
|
|
||||||
class ApiResponse {
|
class ApiResponse {
|
||||||
@ -35,3 +36,4 @@ class ApiResponse {
|
|||||||
class ApiResponseSerializer extends Serializer<ApiResponse> with _$ApiResponseSerializer {
|
class ApiResponseSerializer extends Serializer<ApiResponse> with _$ApiResponseSerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'category.jser.dart';
|
part 'category.jser.dart';
|
||||||
|
|
||||||
class Category {
|
class Category {
|
||||||
@ -31,3 +32,4 @@ class Category {
|
|||||||
class CategorySerializer extends Serializer<Category> with _$CategorySerializer {
|
class CategorySerializer extends Serializer<Category> with _$CategorySerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'order.jser.dart';
|
part 'order.jser.dart';
|
||||||
|
|
||||||
class Order {
|
class Order {
|
||||||
@ -47,3 +48,4 @@ class Order {
|
|||||||
class OrderSerializer extends Serializer<Order> with _$OrderSerializer {
|
class OrderSerializer extends Serializer<Order> with _$OrderSerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:openapi/model/tag.dart';
|
import 'package:openapi/model/tag.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/category.dart';
|
import 'package:openapi/model/category.dart';
|
||||||
|
|
||||||
part 'pet.jser.dart';
|
part 'pet.jser.dart';
|
||||||
|
|
||||||
class Pet {
|
class Pet {
|
||||||
@ -49,3 +52,4 @@ class Pet {
|
|||||||
class PetSerializer extends Serializer<Pet> with _$PetSerializer {
|
class PetSerializer extends Serializer<Pet> with _$PetSerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'tag.jser.dart';
|
part 'tag.jser.dart';
|
||||||
|
|
||||||
class Tag {
|
class Tag {
|
||||||
@ -31,3 +32,4 @@ class Tag {
|
|||||||
class TagSerializer extends Serializer<Tag> with _$TagSerializer {
|
class TagSerializer extends Serializer<Tag> with _$TagSerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
import 'package:jaguar_serializer/jaguar_serializer.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'user.jser.dart';
|
part 'user.jser.dart';
|
||||||
|
|
||||||
class User {
|
class User {
|
||||||
@ -55,3 +56,4 @@ class User {
|
|||||||
class UserSerializer extends Serializer<User> with _$UserSerializer {
|
class UserSerializer extends Serializer<User> with _$UserSerializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ description: OpenAPI API client
|
|||||||
environment:
|
environment:
|
||||||
sdk: ">=2.0.0 <3.0.0"
|
sdk: ">=2.0.0 <3.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
jaguar_retrofit: '^2.5.12'
|
jaguar_retrofit: '^2.8.2'
|
||||||
jaguar_serializer: '^2.2.4'
|
jaguar_serializer: '^2.2.6'
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
jaguar_retrofit_gen: '^2.5.10'
|
jaguar_retrofit_gen: '^2.8.5'
|
||||||
jaguar_serializer_cli: '^2.2.4'
|
jaguar_serializer_cli: '^2.2.5'
|
||||||
build_runner: '^1.1.1'
|
build_runner: '^1.1.1'
|
10
samples/client/petstore/dart-jaguar/flutter_proto_petstore/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.idea
|
||||||
|
.packages
|
||||||
|
.pub/
|
||||||
|
build/
|
||||||
|
ios/.generated/
|
||||||
|
packages
|
||||||
|
pubspec.lock
|
||||||
|
.flutter-plugins
|
@ -0,0 +1,8 @@
|
|||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: 8f65fec5f5f7d7afbb0965f4a44bdb330a28fb19
|
||||||
|
channel: alpha
|
@ -0,0 +1,8 @@
|
|||||||
|
# flutter_petstore
|
||||||
|
|
||||||
|
OpenApi petstore sample flutter
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
For help getting started with Flutter, view our online
|
||||||
|
[documentation](http://flutter.io/).
|
9
samples/client/petstore/dart-jaguar/flutter_proto_petstore/android/.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/libraries
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
GeneratedPluginRegistrant.java
|
@ -0,0 +1,52 @@
|
|||||||
|
def localProperties = new Properties()
|
||||||
|
def localPropertiesFile = rootProject.file('local.properties')
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localPropertiesFile.withInputStream { stream ->
|
||||||
|
localProperties.load(stream)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||||
|
if (flutterRoot == null) {
|
||||||
|
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 25
|
||||||
|
buildToolsVersion '25.0.3'
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
disable 'InvalidPackage'
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
|
applicationId "com.yourcompany.flutterpetstore"
|
||||||
|
minSdkVersion 16
|
||||||
|
targetSdkVersion 25
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
// TODO: Add your own signing config for the release build.
|
||||||
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flutter {
|
||||||
|
source '../..'
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
androidTestCompile 'com.android.support:support-annotations:25.4.0'
|
||||||
|
androidTestCompile 'com.android.support.test:runner:0.5'
|
||||||
|
androidTestCompile 'com.android.support.test:rules:0.5'
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.yourcompany.flutterpetstore">
|
||||||
|
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
flutter needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
|
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||||
|
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||||
|
In most cases you can leave this as-is, but you if you want to provide
|
||||||
|
additional functionality it is fine to subclass or reimplement
|
||||||
|
FlutterApplication and put your custom class here. -->
|
||||||
|
<application
|
||||||
|
android:name="io.flutter.app.FlutterApplication"
|
||||||
|
android:label="flutter_petstore"
|
||||||
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/LaunchTheme"
|
||||||
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
<!-- This keeps the window background of the activity showing
|
||||||
|
until Flutter renders its first frame. It can be removed if
|
||||||
|
there is no splash screen (such as the default splash screen
|
||||||
|
defined in @style/LaunchTheme). -->
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
|
||||||
|
android:value="true" />
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
</manifest>
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.yourcompany.flutterpetstore;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import io.flutter.app.FlutterActivity;
|
||||||
|
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||||
|
|
||||||
|
public class MainActivity extends FlutterActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
GeneratedPluginRegistrant.registerWith(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/white" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
Flutter draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -0,0 +1,31 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url "https://maven.google.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url "https://maven.google.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.buildDir = '../build'
|
||||||
|
subprojects {
|
||||||
|
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||||
|
project.evaluationDependsOn(':app')
|
||||||
|
}
|
||||||
|
|
||||||
|
task clean(type: Delete) {
|
||||||
|
delete rootProject.buildDir
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
org.gradle.jvmargs=-Xmx1536M
|
@ -0,0 +1,6 @@
|
|||||||
|
#Fri Jun 23 08:50:38 CEST 2017
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
160
samples/client/petstore/dart-jaguar/flutter_proto_petstore/android/gradlew
vendored
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
90
samples/client/petstore/dart-jaguar/flutter_proto_petstore/android/gradlew.bat
vendored
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
@ -0,0 +1,15 @@
|
|||||||
|
include ':app'
|
||||||
|
|
||||||
|
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||||
|
|
||||||
|
def plugins = new Properties()
|
||||||
|
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||||
|
if (pluginsFile.exists()) {
|
||||||
|
pluginsFile.withInputStream { stream -> plugins.load(stream) }
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins.each { name, path ->
|
||||||
|
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||||
|
include ":$name"
|
||||||
|
project(":$name").projectDir = pluginDirectory
|
||||||
|
}
|
41
samples/client/petstore/dart-jaguar/flutter_proto_petstore/ios/.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
.idea/
|
||||||
|
.vagrant/
|
||||||
|
.sconsign.dblite
|
||||||
|
.svn/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
*.swp
|
||||||
|
profile
|
||||||
|
|
||||||
|
DerivedData/
|
||||||
|
build/
|
||||||
|
GeneratedPluginRegistrant.h
|
||||||
|
GeneratedPluginRegistrant.m
|
||||||
|
|
||||||
|
*.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
|
||||||
|
!default.pbxuser
|
||||||
|
!default.mode1v3
|
||||||
|
!default.mode2v3
|
||||||
|
!default.perspectivev3
|
||||||
|
|
||||||
|
xcuserdata
|
||||||
|
|
||||||
|
*.moved-aside
|
||||||
|
|
||||||
|
*.pyc
|
||||||
|
*sync/
|
||||||
|
Icon?
|
||||||
|
.tags*
|
||||||
|
|
||||||
|
/Flutter/app.flx
|
||||||
|
/Flutter/app.zip
|
||||||
|
/Flutter/App.framework
|
||||||
|
/Flutter/Flutter.framework
|
||||||
|
/Flutter/Generated.xcconfig
|
||||||
|
/ServiceDefinitions.json
|
||||||
|
|
||||||
|
Pods/
|
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>io.flutter.flutter.app</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>8.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1 @@
|
|||||||
|
#include "Generated.xcconfig"
|
@ -0,0 +1 @@
|
|||||||
|
#include "Generated.xcconfig"
|
@ -0,0 +1 @@
|
|||||||
|
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
|
@ -0,0 +1 @@
|
|||||||
|
[{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]
|
@ -0,0 +1,436 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 46;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
|
||||||
|
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
||||||
|
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
|
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
||||||
|
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
|
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
|
||||||
|
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
|
||||||
|
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
|
||||||
|
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
||||||
|
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
||||||
|
);
|
||||||
|
name = "Embed Frameworks";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
|
||||||
|
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||||
|
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||||
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||||
|
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B80C3931E831B6300D905FE /* App.framework */,
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
|
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
|
||||||
|
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146E51CF9000F007C117D = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146EF1CF9000F007C117D /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
|
||||||
|
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */,
|
||||||
|
97C146F11CF9000F007C117D /* Supporting Files */,
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146F11CF9000F007C117D /* Supporting Files */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146F21CF9000F007C117D /* main.m */,
|
||||||
|
);
|
||||||
|
name = "Supporting Files";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0910;
|
||||||
|
ORGANIZATIONNAME = "The Chromium Authors";
|
||||||
|
TargetAttributes = {
|
||||||
|
97C146ED1CF9000F007C117D = {
|
||||||
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
|
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
|
||||||
|
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Thin Binary";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
||||||
|
};
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Run Script";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
|
||||||
|
97C146F31CF9000F007C117D /* main.m in Sources */,
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C146FB1CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = Main.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C147001CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
97C147031CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147041CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
97C147061CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = arm64;
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/Flutter",
|
||||||
|
);
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
LIBRARY_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/Flutter",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterPetstore;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147071CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = arm64;
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/Flutter",
|
||||||
|
);
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
LIBRARY_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/Flutter",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterPetstore;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147031CF9000F007C117D /* Debug */,
|
||||||
|
97C147041CF9000F007C117D /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147061CF9000F007C117D /* Debug */,
|
||||||
|
97C147071CF9000F007C117D /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0910"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
language = ""
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
language = ""
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,6 @@
|
|||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <Flutter/Flutter.h>
|
||||||
|
|
||||||
|
@interface AppDelegate : FlutterAppDelegate
|
||||||
|
|
||||||
|
@end
|
@ -0,0 +1,12 @@
|
|||||||
|
#include "AppDelegate.h"
|
||||||
|
#include "GeneratedPluginRegistrant.h"
|
||||||
|
|
||||||
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||||
|
[GeneratedPluginRegistrant registerWithRegistry:self];
|
||||||
|
// Override point for customization after application launch.
|
||||||
|
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@ -0,0 +1,116 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
@ -0,0 +1,5 @@
|
|||||||
|
# Launch Screen Assets
|
||||||
|
|
||||||
|
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||||
|
|
||||||
|
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||||
|
</imageView>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||||
|
</constraints>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="53" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<resources>
|
||||||
|
<image name="LaunchImage" width="168" height="185"/>
|
||||||
|
</resources>
|
||||||
|
</document>
|
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--Flutter View Controller-->
|
||||||
|
<scene sceneID="tne-QT-ifu">
|
||||||
|
<objects>
|
||||||
|
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>flutter_petstore</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIMainStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,9 @@
|
|||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <Flutter/Flutter.h>
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
int main(int argc, char * argv[]) {
|
||||||
|
@autoreleasepool {
|
||||||
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,174 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:http/io_client.dart';
|
||||||
|
import 'package:openapi/api.dart';
|
||||||
|
import 'package:openapi/model/order.pb.dart';
|
||||||
|
import 'package:openapi/model/pet.pb.dart';
|
||||||
|
import 'package:openapi/model/user.pb.dart';
|
||||||
|
import 'package:jaguar_resty/jaguar_resty.dart';
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
globalClient = IOClient();
|
||||||
|
runApp(MyApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatelessWidget {
|
||||||
|
// This widget is the root of your application.
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
title: 'Flutter Demo',
|
||||||
|
theme: ThemeData(
|
||||||
|
// This is the theme of your application.
|
||||||
|
//
|
||||||
|
// Try running your application with "flutter run". You'll see the
|
||||||
|
// application has a blue toolbar. Then, without quitting the app, try
|
||||||
|
// changing the primarySwatch below to Colors.green and then invoke
|
||||||
|
// "hot reload" (press "r" in the console where you ran "flutter run",
|
||||||
|
// or press Run > Flutter Hot Reload in IntelliJ). Notice that the
|
||||||
|
// counter didn't reset back to zero; the application is not restarted.
|
||||||
|
primarySwatch: Colors.blue,
|
||||||
|
),
|
||||||
|
home: MyHomePage(title: 'Flutter Demo Home Page'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyHomePage extends StatefulWidget {
|
||||||
|
MyHomePage({Key key, this.title}) : super(key: key);
|
||||||
|
|
||||||
|
// This widget is the home page of your application. It is stateful, meaning
|
||||||
|
// that it has a State object (defined below) that contains fields that affect
|
||||||
|
// how it looks.
|
||||||
|
|
||||||
|
// This class is the configuration for the state. It holds the values (in this
|
||||||
|
// case the title) provided by the parent (in this case the App widget) and
|
||||||
|
// used by the build method of the State. Fields in a Widget subclass are
|
||||||
|
// always marked "final".
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_MyHomePageState createState() => _MyHomePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyHomePageState extends State<MyHomePage> {
|
||||||
|
int _counter = 0;
|
||||||
|
JaguarApiGen jaguarApiGen = JaguarApiGen();
|
||||||
|
|
||||||
|
void _incrementCounter() {
|
||||||
|
setState(() {
|
||||||
|
// This call to setState tells the Flutter framework that something has
|
||||||
|
// changed in this State, which causes it to rerun the build method below
|
||||||
|
// so that the display can reflect the updated values. If we changed
|
||||||
|
// _counter without calling setState(), then the build method would not be
|
||||||
|
// called again, and so nothing would appear to happen.
|
||||||
|
_counter++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
fetchPets();
|
||||||
|
fetchStoreInventory();
|
||||||
|
fetchUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetchPets() {
|
||||||
|
print('fetching pets by status...');
|
||||||
|
var statuses = List<String>();
|
||||||
|
statuses.add('available');
|
||||||
|
jaguarApiGen.getPetApi().findPetsByStatus(statuses)
|
||||||
|
.then((List<Pet> pets) {
|
||||||
|
print('pets received: ');
|
||||||
|
print(pets);
|
||||||
|
var order = Order();
|
||||||
|
order.petId = pets[0].id;
|
||||||
|
order.quantity = 1;
|
||||||
|
jaguarApiGen.getStoreApi().placeOrder(order)
|
||||||
|
.then((Order order) => print(order));
|
||||||
|
}).catchError((error) {
|
||||||
|
print('error fetching pets');
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetchStoreInventory() {
|
||||||
|
print('fetching inventory...');
|
||||||
|
jaguarApiGen.getStoreApi().getInventory()
|
||||||
|
.then((Map inventory) {
|
||||||
|
print('inventory received: ');
|
||||||
|
print(inventory);
|
||||||
|
}).catchError((error) {
|
||||||
|
print('error fetching inventory');
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetchUser() {
|
||||||
|
print('fetching user1...');
|
||||||
|
jaguarApiGen.getUserApi().getUserByName('user1')
|
||||||
|
.then((User user) {
|
||||||
|
print('user received: ');
|
||||||
|
print(user);
|
||||||
|
}).catchError((error) {
|
||||||
|
print('error fetching user');
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// This method is rerun every time setState is called, for instance as done
|
||||||
|
// by the _incrementCounter method above.
|
||||||
|
//
|
||||||
|
// The Flutter framework has been optimized to make rerunning build methods
|
||||||
|
// fast, so that you can just rebuild anything that needs updating rather
|
||||||
|
// than having to individually change instances of widgets.
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
// Here we take the value from the MyHomePage object that was created by
|
||||||
|
// the App.build method, and use it to set our appbar title.
|
||||||
|
title: Text(widget.title),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
// Center is a layout widget. It takes a single child and positions it
|
||||||
|
// in the middle of the parent.
|
||||||
|
child: Column(
|
||||||
|
// Column is also layout widget. It takes a list of children and
|
||||||
|
// arranges them vertically. By default, it sizes itself to fit its
|
||||||
|
// children horizontally, and tries to be as tall as its parent.
|
||||||
|
//
|
||||||
|
// Invoke "debug paint" (press "p" in the console where you ran
|
||||||
|
// "flutter run", or select "Toggle Debug Paint" from the Flutter tool
|
||||||
|
// window in IntelliJ) to see the wireframe for each widget.
|
||||||
|
//
|
||||||
|
// Column has various properties to control how it sizes itself and
|
||||||
|
// how it positions its children. Here we use mainAxisAlignment to
|
||||||
|
// center the children vertically; the main axis here is the vertical
|
||||||
|
// axis because Columns are vertical (the cross axis would be
|
||||||
|
// horizontal).
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'You have pushed the button this many times:',
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'$_counter',
|
||||||
|
style: Theme
|
||||||
|
.of(context)
|
||||||
|
.textTheme
|
||||||
|
.display1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: _incrementCounter,
|
||||||
|
tooltip: 'Increment',
|
||||||
|
child: Icon(Icons.add),
|
||||||
|
), // This trailing comma makes auto-formatting nicer for build methods.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
analyzer:
|
||||||
|
strong-mode: true
|
27
samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.gitignore
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# See https://www.dartlang.org/tools/private-files.html
|
||||||
|
|
||||||
|
# Files and directories created by pub
|
||||||
|
.buildlog
|
||||||
|
.packages
|
||||||
|
.project
|
||||||
|
.pub/
|
||||||
|
build/
|
||||||
|
**/packages/
|
||||||
|
|
||||||
|
# Files created by dart2js
|
||||||
|
# (Most Dart developers will use pub build to compile Dart, use/modify these
|
||||||
|
# rules if you intend to use dart2js directly
|
||||||
|
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
|
||||||
|
# differentiate from explicit Javascript files)
|
||||||
|
*.dart.js
|
||||||
|
*.part.js
|
||||||
|
*.js.deps
|
||||||
|
*.js.map
|
||||||
|
*.info.json
|
||||||
|
|
||||||
|
# Directory created by dartdoc
|
||||||
|
doc/api/
|
||||||
|
|
||||||
|
# Don't commit pubspec lock file
|
||||||
|
# (Library packages only! Remove pattern if developing an application package)
|
||||||
|
pubspec.lock
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -0,0 +1 @@
|
|||||||
|
4.0.0-SNAPSHOT
|
@ -0,0 +1,131 @@
|
|||||||
|
# openapi
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Build date: 2019-03-01T12:01:29.772495+01:00[Europe/Paris]
|
||||||
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Dart 2 or later OR Flutter 0.7.0 or later.
|
||||||
|
|
||||||
|
Once your code is generated, you need to run the build_runner command to let Jaguar implement your API:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
flutter packages pub run build_runner build
|
||||||
|
or
|
||||||
|
pub run build_runner build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation & Usage
|
||||||
|
|
||||||
|
### Github
|
||||||
|
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||||
|
```
|
||||||
|
name: openapi
|
||||||
|
version: 1.0.0
|
||||||
|
description: OpenAPI API client
|
||||||
|
dependencies:
|
||||||
|
openapi:
|
||||||
|
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||||
|
version: 'any'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Local
|
||||||
|
To use the package in your local drive, please include the following in pubspec.yaml
|
||||||
|
```
|
||||||
|
dependencies:
|
||||||
|
openapi:
|
||||||
|
path: /path/to/openapi
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
|
```dart
|
||||||
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
|
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final jaguarApiGen = JaguarApiGen();
|
||||||
|
var api_instance = jaguarApiGen.getPetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try {
|
||||||
|
api_instance.addPet(body);
|
||||||
|
} catch (e) {
|
||||||
|
print("Exception when calling PetApi->addPet: $e\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet
|
||||||
|
*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID
|
||||||
|
*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID
|
||||||
|
*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user
|
||||||
|
*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user
|
||||||
|
*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name
|
||||||
|
*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [ApiResponse](docs//ApiResponse.md)
|
||||||
|
- [Category](docs//Category.md)
|
||||||
|
- [Order](docs//Order.md)
|
||||||
|
- [Pet](docs//Pet.md)
|
||||||
|
- [Tag](docs//Tag.md)
|
||||||
|
- [User](docs//User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
analyzer:
|