fix http client

This commit is contained in:
Ivan Murashov
2018-05-29 00:12:42 +03:00
parent d569a6efd8
commit 2044843a4e
9 changed files with 73 additions and 105 deletions

View File

@@ -5,7 +5,6 @@
.pub/ .pub/
.gradle/ .gradle/
.orig .orig
build/ build/
gen/ gen/
pubspec.lock pubspec.lock
@@ -19,10 +18,37 @@ ios/Pods/
android/local.properties android/local.properties
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
android/android.iml android/*.iml
android/app/app.iml android/app/*.iml
android/.idea/ android/.idea/
android/build/ android/build/
android/.DS_Store android/.DS_Store
android/captures android/captures
android/gradle android/gradle
ios/.idea/
ios/.vagrant/
ios/.sconsign.dblite
ios/.svn/
ios/.DS_Store
ios/profile
ios/DerivedData/
ios/build/
ios/GeneratedPluginRegistrant.h
ios/GeneratedPluginRegistrant.m
ios/!default.pbxuser
ios/!default.mode1v3
ios/!default.mode2v3
ios/!default.perspectivev3
ios/Runner.xcodeproj/xcuserdata
ios/Runner.xcworkspace/xcuserdata
ios/Icon?
ios/.tags*
ios/Flutter/app.flx
ios/Flutter/app.zip
ios/Flutter/App.framework
ios/Flutter/Flutter.framework
ios/Flutter/Generated.xcconfig
ios/ServiceDefinitions.json
ios/Pods/

View File

@@ -1,32 +0,0 @@
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
profile
DerivedData/
build/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
Runner.xcodeproj/xcuserdata
Runner.xcworkspace/xcuserdata
Icon?
.tags*
Flutter/app.flx
Flutter/app.zip
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Generated.xcconfig
ServiceDefinitions.json
Pods/

Binary file not shown.

View File

@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
Defines a set of optional callback methods and a method to set up the plugin Defines a set of optional callback methods and a method to set up the plugin
and register it to be called by other application components. and register it to be called by other application components.
*/ */
@protocol FlutterPlugin<NSObject> @protocol FlutterPlugin <NSObject>
@required @required
/** /**
Registers this plugin. Registers this plugin.
@@ -130,12 +130,28 @@ NS_ASSUME_NONNULL_BEGIN
completionHandler:(void (^)(BOOL succeeded))completionHandler completionHandler:(void (^)(BOOL succeeded))completionHandler
API_AVAILABLE(ios(9.0)); API_AVAILABLE(ios(9.0));
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
handleEventsForBackgroundURLSession:(nonnull NSString*)identifier
completionHandler:(nonnull void (^)())completionHandler;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
@end @end
/** /**
Registration context for a single `FlutterPlugin`. Registration context for a single `FlutterPlugin`.
*/ */
@protocol FlutterPluginRegistrar<NSObject> @protocol FlutterPluginRegistrar <NSObject>
/** /**
Returns a `FlutterBinaryMessenger` for creating Dart/iOS communication Returns a `FlutterBinaryMessenger` for creating Dart/iOS communication
channels to be used by the plugin. channels to be used by the plugin.
@@ -211,7 +227,7 @@ NS_ASSUME_NONNULL_BEGIN
Plugins are identified by unique string keys, typically the name of the Plugins are identified by unique string keys, typically the name of the
plugin's main class. plugin's main class.
*/ */
@protocol FlutterPluginRegistry<NSObject> @protocol FlutterPluginRegistry <NSObject>
/** /**
Returns a registrar for registering a plugin. Returns a registrar for registering a plugin.

View File

@@ -1,9 +1,9 @@
// This is a generated file; do not edit or check into version control. // This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/kifio/flutter FLUTTER_ROOT=/Users/imurashov/flutter
FLUTTER_APPLICATION_PATH=/Users/kifio/Desktop/AndroidStudioProjects/checker FLUTTER_APPLICATION_PATH=/Users/imurashov/AndroidStudioProjects/checker
FLUTTER_TARGET=lib/main.dart FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_MODE=debug FLUTTER_BUILD_MODE=debug
FLUTTER_BUILD_DIR=build FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_FRAMEWORK_DIR=/Users/kifio/flutter/bin/cache/artifacts/engine/ios FLUTTER_FRAMEWORK_DIR=/Users/imurashov/flutter/bin/cache/artifacts/engine/ios
PREVIEW_DART_2=true PREVIEW_DART_2=true

View File

@@ -17,21 +17,27 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- DropDown - DropDown
- Flutter (from `/Users/kifio/flutter/bin/cache/artifacts/engine/ios`) - Flutter (from `/Users/imurashov/flutter/bin/cache/artifacts/engine/ios`)
- image_picker (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.1/ios`) - image_picker (from `/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.2/ios`)
- path_provider (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`) - path_provider (from `/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`)
- sqflite (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/sqflite-0.8.9/ios`) - sqflite (from `/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-0.8.9/ios`)
- ZXingObjC (~> 3.2.2) - ZXingObjC (~> 3.2.2)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- DropDown
- FMDB
- ZXingObjC
EXTERNAL SOURCES: EXTERNAL SOURCES:
Flutter: Flutter:
:path: /Users/kifio/flutter/bin/cache/artifacts/engine/ios :path: "/Users/imurashov/flutter/bin/cache/artifacts/engine/ios"
image_picker: image_picker:
:path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.1/ios :path: "/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.2/ios"
path_provider: path_provider:
:path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios :path: "/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios"
sqflite: sqflite:
:path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/sqflite-0.8.9/ios :path: "/Users/imurashov/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-0.8.9/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
DropDown: 20499c7b2731b0d21609af924e47c7677a2be50d DropDown: 20499c7b2731b0d21609af924e47c7677a2be50d
@@ -44,4 +50,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: fb0878732874759a90764b55aa8df21a11e17dea PODFILE CHECKSUM: fb0878732874759a90764b55aa8df21a11e17dea
COCOAPODS: 1.4.0 COCOAPODS: 1.5.3

View File

@@ -493,7 +493,6 @@
328A58A8205F68270039EA5A /* Thin Binary */, 328A58A8205F68270039EA5A /* Thin Binary */,
328A58AB205F68270039EA5A /* Embed App Extensions */, 328A58AB205F68270039EA5A /* Embed App Extensions */,
6E9F689CE5297FBCEFCE9185 /* [CP] Embed Pods Frameworks */, 6E9F689CE5297FBCEFCE9185 /* [CP] Embed Pods Frameworks */,
16DCB7DE1CB0B0762DA83619 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -517,7 +516,6 @@
ACE861481F9F745B006FEF38 /* Thin Binary */, ACE861481F9F745B006FEF38 /* Thin Binary */,
ACE8614B1F9F745B006FEF38 /* Embed App Extensions */, ACE8614B1F9F745B006FEF38 /* Embed App Extensions */,
14E6B282F82D294B9F247C19 /* [CP] Embed Pods Frameworks */, 14E6B282F82D294B9F247C19 /* [CP] Embed Pods Frameworks */,
80D354ABB7AEC9E050CA7E41 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -541,7 +539,6 @@
FB862E7E20548D6C00C04986 /* Thin Binary */, FB862E7E20548D6C00C04986 /* Thin Binary */,
FB862E7F20548D6C00C04986 /* Embed App Extensions */, FB862E7F20548D6C00C04986 /* Embed App Extensions */,
811E5FE62416D2D93E92FC13 /* [CP] Embed Pods Frameworks */, 811E5FE62416D2D93E92FC13 /* [CP] Embed Pods Frameworks */,
0E5872E5A458D815B718BEF6 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -729,21 +726,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
0E5872E5A458D815B718BEF6 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Crypto/Pods-Crypto-resources.sh\"\n";
showEnvVarsInLog = 0;
};
14E6B282F82D294B9F247C19 /* [CP] Embed Pods Frameworks */ = { 14E6B282F82D294B9F247C19 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@@ -753,7 +735,7 @@
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework", "${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${PODS_ROOT}/../../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", "${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework", "${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework",
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
@@ -774,21 +756,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
16DCB7DE1CB0B0762DA83619 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Dinect/Pods-Dinect-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3226052020806CE500706A11 /* Run Script */ = { 3226052020806CE500706A11 /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@@ -854,7 +821,7 @@
"${SRCROOT}/Pods/Target Support Files/Pods-Dinect/Pods-Dinect-frameworks.sh", "${SRCROOT}/Pods/Target Support Files/Pods-Dinect/Pods-Dinect-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework", "${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${PODS_ROOT}/../../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", "${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework", "${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework",
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
@@ -893,21 +860,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
80D354ABB7AEC9E050CA7E41 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
811E5FE62416D2D93E92FC13 /* [CP] Embed Pods Frameworks */ = { 811E5FE62416D2D93E92FC13 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@@ -917,7 +869,7 @@
"${SRCROOT}/Pods/Target Support Files/Pods-Crypto/Pods-Crypto-frameworks.sh", "${SRCROOT}/Pods/Target Support Files/Pods-Crypto/Pods-Crypto-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework", "${BUILT_PRODUCTS_DIR}/DropDown/DropDown.framework",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${PODS_ROOT}/../../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", "${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework", "${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework",
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",

View File

@@ -1,12 +1,12 @@
import 'dart:io';
import 'package:checker/strings.dart'; import 'package:checker/strings.dart';
import 'package:flutter/services.dart'; import 'package:http/http.dart';
import 'package:http/http.dart' as http;
import 'common.dart'; import 'common.dart';
// Клиент http приложения // Клиент http приложения
final httpClient = createHttpClient(); final httpClient = new Client();
// Попытка создать токен для кассы. // Попытка создать токен для кассы.
// В случае если токен для кассы уже существует, вернется ошибка 409. // В случае если токен для кассы уже существует, вернется ошибка 409.
// На сервере есть ограничение в 40 токенов. // На сервере есть ограничение в 40 токенов.