diff --git a/.hgignore b/.hgignore index 7351c22..04ad415 100644 --- a/.hgignore +++ b/.hgignore @@ -12,6 +12,8 @@ packages pubspec.lock .flutter-plugins +ios/Flutter + android/gradle android/gradlew android/gradlew.bat diff --git a/ios/Flutter/App.framework/App b/ios/Flutter/App.framework/App index f33db0d..1faf0d3 100755 Binary files a/ios/Flutter/App.framework/App and b/ios/Flutter/App.framework/App differ diff --git a/ios/Flutter/Flutter.framework/Flutter b/ios/Flutter/Flutter.framework/Flutter index 982332d..1e8afe3 100755 Binary files a/ios/Flutter/Flutter.framework/Flutter and b/ios/Flutter/Flutter.framework/Flutter differ diff --git a/ios/Flutter/Flutter.framework/Headers/Flutter.h b/ios/Flutter/Flutter.framework/Headers/Flutter.h index a47e239..87604cf 100644 --- a/ios/Flutter/Flutter.framework/Headers/Flutter.h +++ b/ios/Flutter/Flutter.framework/Headers/Flutter.h @@ -5,14 +5,22 @@ #ifndef FLUTTER_FLUTTER_H_ #define FLUTTER_FLUTTER_H_ +/** + BREAKING CHANGES: + + November 29, 2017: Added a BREAKING CHANGES section. + */ + #include "FlutterAppDelegate.h" #include "FlutterBinaryMessenger.h" #include "FlutterChannels.h" #include "FlutterCodecs.h" #include "FlutterDartProject.h" +#include "FlutterHeadlessDartRunner.h" #include "FlutterMacros.h" #include "FlutterNavigationController.h" #include "FlutterPlugin.h" +#include "FlutterTexture.h" #include "FlutterViewController.h" #endif // FLUTTER_FLUTTER_H_ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h b/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h index a2ad157..4f28e70 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h @@ -34,6 +34,12 @@ FLUTTER_EXPORT // Defaults to window's rootViewController. - (NSObject*)binaryMessenger; +// Can be overriden by subclasses to provide a custom FlutterTextureRegistry, +// typically a FlutterViewController, for plugin interop. +// +// Defaults to window's rootViewController. +- (NSObject*)textures; + @end #endif // FLUTTER_FLUTTERDARTPROJECT_H_ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h b/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h index 6c417f4..3056f46 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h @@ -291,6 +291,10 @@ FLUTTER_EXPORT Invoked when the last listener is deregistered from the Stream associated to this channel on the Flutter side. + The channel implementation may call this method with `nil` arguments + to separate a pair of two consecutive set up requests. Such request pairs + may occur during Flutter hot restart. + - Parameter arguments: Arguments for the stream. - Returns: A FlutterError instance, if teardown fails. */ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h b/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h index 89b7e66..0d191db 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h @@ -99,7 +99,7 @@ FLUTTER_EXPORT On the Dart side, these values are represented as follows: - - `nil` or `NSNull`: `null` + - `nil` or `NSNull`: null - `NSNumber`: `bool`, `int`, or `double`, depending on the contained value. - `FlutterStandardBigInteger`: `int` - `NSString`: `String` diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h b/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h new file mode 100644 index 0000000..522766e --- /dev/null +++ b/ios/Flutter/Flutter.framework/Headers/FlutterHeadlessDartRunner.h @@ -0,0 +1,34 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_ +#define FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_ + +#import + +#include "FlutterDartProject.h" +#include "FlutterMacros.h" + +/** + The FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer, + and no native drawing surface. It is appropriate for use in running Dart + code e.g. in the background from a plugin. +*/ +FLUTTER_EXPORT +@interface FlutterHeadlessDartRunner : NSObject + +/** + Runs a Dart function on an Isolate that is not the main application's Isolate. + The first call will create a new Isolate. Subsequent calls will reuse that + Isolate. The Isolate is destroyed when the FlutterHeadlessDartRunner is + destroyed. + + - Parameter entrypoint: The name of a top-level function from the same Dart + library that contains the app's main() function. +*/ +- (void)runWithEntrypoint:(NSString*)entrypoint; + +@end + +#endif // FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h b/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h index 4e32b6c..ea19d1c 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterMacros.h @@ -20,4 +20,21 @@ #define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") #endif // defined(NS_ASSUME_NONNULL_BEGIN) +/** + Indicates that the API has been deprecated for the specifed reason. Code that + uses the deprecated API will continue to work as before. However, the API will + soon become unavailable and users are encouraged to immediately take the + appropriate action mentioned in the deprecation message and the BREAKING + CHANGES section present in the Flutter.h umbrella header. + */ +#define FLUTTER_DEPRECATED(msg) __attribute__((__deprecated__(msg))) + +/** + Indicates that the previously deprecated API is now unavailable. Code that + uses the API will not work and the declaration of the API is only a stub meant + to display the given message detailing the actions for the user to take + immediately. + */ +#define FLUTTER_UNAVAILABLE(msg) __attribute__((__unavailable__(msg))) + #endif // FLUTTER_FLUTTERMACROS_H_ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h b/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h index 660e14a..fece7fe 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h @@ -10,6 +10,7 @@ #include "FlutterBinaryMessenger.h" #include "FlutterChannels.h" #include "FlutterCodecs.h" +#include "FlutterTexture.h" NS_ASSUME_NONNULL_BEGIN @protocol FlutterPluginRegistrar; @@ -142,6 +143,14 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSObject*)messenger; +/** + Returns a `FlutterTextureRegistry` for registering textures + provided by the plugin. + + - Returns: The texture registry. + */ +- (NSObject*)textures; + /** Publishes a value for external use of the plugin. diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h b/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h new file mode 100644 index 0000000..c755ebf --- /dev/null +++ b/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h @@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_FLUTTERTEXTURE_H_ +#define FLUTTER_FLUTTERTEXTURE_H_ + +#import +#import + +#include "FlutterMacros.h" + +NS_ASSUME_NONNULL_BEGIN + +FLUTTER_EXPORT +@protocol FlutterTexture +- (CVPixelBufferRef)copyPixelBuffer; +@end + +FLUTTER_EXPORT +@protocol FlutterTextureRegistry +- (int64_t)registerTexture:(NSObject*)texture; +- (void)textureFrameAvailable:(int64_t)textureId; +- (void)unregisterTexture:(int64_t)textureId; +@end + +NS_ASSUME_NONNULL_END + +#endif // FLUTTER_FLUTTERTEXTURE_H_ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h b/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h index 18480cb..68e0d0f 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterViewController.h @@ -11,9 +11,10 @@ #include "FlutterBinaryMessenger.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" +#include "FlutterTexture.h" FLUTTER_EXPORT -@interface FlutterViewController : UIViewController +@interface FlutterViewController : UIViewController - (instancetype)initWithProject:(FlutterDartProject*)project nibName:(NSString*)nibNameOrNil diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig index 496f0f7..2170381 100644 --- a/ios/Flutter/Generated.xcconfig +++ b/ios/Flutter/Generated.xcconfig @@ -1,9 +1,9 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/ntrlab/flutter -FLUTTER_APPLICATION_PATH=/Users/ntrlab/semyon/apps/dinect -FLUTTER_TARGET=lib/main.dart +FLUTTER_ROOT=/Users/supermyon/Documents/flutter +FLUTTER_APPLICATION_PATH=/Users/supermyon/Documents/Apps/checker +FLUTTER_TARGET=/Users/supermyon/Documents/Apps/checker/lib/main.dart FLUTTER_BUILD_MODE=debug FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios -FLUTTER_FRAMEWORK_DIR=/Users/ntrlab/flutter/bin/cache/artifacts/engine/ios +FLUTTER_FRAMEWORK_DIR=/Users/supermyon/Documents/flutter/bin/cache/artifacts/engine/ios #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/ios/Flutter/app.flx b/ios/Flutter/app.flx index b2f5f1b..a703175 100644 Binary files a/ios/Flutter/app.flx and b/ios/Flutter/app.flx differ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9d22e06..86860ac 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,8 +1,8 @@ PODS: - Flutter (1.0.0) - - FMDB (2.6.2): - - FMDB/standard (= 2.6.2) - - FMDB/standard (2.6.2) + - FMDB (2.7.2): + - FMDB/standard (= 2.7.2) + - FMDB/standard (2.7.2) - image_picker (0.0.1): - Flutter - path_provider (0.0.1): @@ -12,28 +12,28 @@ PODS: - FMDB DEPENDENCIES: - - Flutter (from `/Users/ntrlab/flutter/bin/cache/artifacts/engine/ios`) - - image_picker (from `/Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.3/ios`) - - path_provider (from `/Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.1+1/ios`) - - sqflite (from `/Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/sqflite-0.2.4/ios`) + - Flutter (from `/Users/supermyon/Documents/flutter/bin/cache/artifacts/engine/ios`) + - image_picker (from `/Users/supermyon/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios`) + - path_provider (from `/Users/supermyon/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`) + - sqflite (from `/Users/supermyon/.pub-cache/hosted/pub.dartlang.org/sqflite-0.2.4/ios`) EXTERNAL SOURCES: Flutter: - :path: /Users/ntrlab/flutter/bin/cache/artifacts/engine/ios + :path: /Users/supermyon/Documents/flutter/bin/cache/artifacts/engine/ios image_picker: - :path: /Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.3/ios + :path: /Users/supermyon/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios path_provider: - :path: /Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.1+1/ios + :path: /Users/supermyon/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios sqflite: - :path: /Users/ntrlab/.pub-cache/hosted/pub.dartlang.org/sqflite-0.2.4/ios + :path: /Users/supermyon/.pub-cache/hosted/pub.dartlang.org/sqflite-0.2.4/ios SPEC CHECKSUMS: Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf - FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a + FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa image_picker: a211f28b95a560433c00f5cd3773f4710a20404d path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 sqflite: 8e2d9fe1e7cdc95d4d537fc7eb2d23c8dc428e3c PODFILE CHECKSUM: 351e02e34b831289961ec3558a535cbd2c4965d2 -COCOAPODS: 1.2.1 +COCOAPODS: 1.3.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index cef29c5..b2cda06 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -370,7 +370,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - 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"; + 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; }; ACE861291F9F745B006FEF38 /* Run Script */ = { @@ -408,7 +408,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../../../flutter/bin/cache/artifacts/engine/ios-release/Flutter.framework", + "${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( diff --git a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..abe3a42 Binary files /dev/null and b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ed9a9b4 --- /dev/null +++ b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index aa5d80c..848f73b 100644 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -92,6 +92,9 @@ ScannerViewController *modalViewController = [ScannerViewController new]; modalViewController.platformChannel = weekPlatformChannel; [controller presentViewController:modalViewController animated:YES completion:nil]; +// [weekPlatformChannel invokeMethod:(@"findUserAndPurchase") arguments: @[@"79039441628", @"phone"]]; + + } else if ([@"isOnline" isEqualToString:call.method]) { result(@YES); } else if ([@"getSupportPhone" isEqualToString:call.method]) { diff --git a/ios/Runner/ScannerViewController.swift b/ios/Runner/ScannerViewController.swift index 329a1d0..6e010b4 100644 --- a/ios/Runner/ScannerViewController.swift +++ b/ios/Runner/ScannerViewController.swift @@ -81,6 +81,7 @@ extension ZBarSymbolSet: Sequence { self.addChildViewController(readerViewController) self.view.addSubview(readerViewController.view) + readerViewController.didMove(toParentViewController: self) readerViewController.view.addSubview(topView) topView.addSubview(textField) @@ -120,11 +121,14 @@ extension ZBarSymbolSet: Sequence { } func sendResult(_ str: String) { - platformChannel?.invokeMethod("findUserAndPurchase", arguments: [str, buttonState.searchType], result: { (result: Any?) in + platformChannel?.invokeMethod("findUser", arguments: [str, buttonState.searchType], result: { (result: Any?) in if result is FlutterError { self.showErrorAlert(str) } else { - self.presentingViewController?.dismiss(animated: false, completion: { self.dismiss(animated: true) }) + + self.dismiss(animated: true) { + self.platformChannel?.invokeMethod("purchase", arguments: [result, str]) + } } print("result: \(result.debugDescription )") }) @@ -139,6 +143,9 @@ extension ZBarSymbolSet: Sequence { ) alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.default,handler: nil)) +// if let appDelegate = UIApplication.shared.delegate as? FlutterAppDelegate { +// appDelegate.window.rootViewController?.present(alertController, animated: true, completion: nil) +// } self.present(alertController, animated: true, completion: nil) } @@ -157,7 +164,7 @@ extension ZBarSymbolSet: Sequence { readerViewController.view.frame = view.bounds topView.frame = CGRect(x: 0, y: 0, width: readerViewController.view.frame.size.width, height: 40) - textField.frame = CGRect(x: settingButton.frame.maxX + 8, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30) + textField.frame = CGRect(x: settingButton.frame.maxX + 8 + 20 + 5, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30) settingButton.frame = CGRect(x: 8, y: 10, width: 20, height: 20) } diff --git a/lib/common.dart b/lib/common.dart index 73af568..cc05687 100644 --- a/lib/common.dart +++ b/lib/common.dart @@ -101,7 +101,7 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async { if (call.method == 'logout') { forceLogout(token, context); - } else if (call.method == 'findUserAndPurchase') { + } else if (call.method == 'findUser') { var userResponse; String cardPhone = call.arguments[0]; @@ -129,25 +129,10 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async { print(error); } - print(users.length); - if (users.length > 0) { - String userString = '${users[0]['first_name']} ${users[0]['last_name']}'; - - print(userString); - print(cardPhone); -// pushRoute(context, new PurchaseScreen(helper, app, JSON.encode(users[0]), cardPhone)); - - var route = new MaterialPageRoute( - builder: (BuildContext context) => - new PurchaseScreen(helper, app, JSON.encode(users[0]), cardPhone) - ); - while (Navigator.of(context).canPop()) { - Navigator.of(context).pop(); - } - Navigator.of(context).pushReplacement(route); - + return users[0]; } else { + startScanner(context, app, helper); throw new FlutterError("Users not found"); } @@ -157,8 +142,16 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async { } else if (call.method == 'settings') { pushRoute(context, new SettingsScreen(helper, app, true)); } else { - String userString = call.arguments[0]; + String userString; + + if (call.arguments[0] is String) { + userString = call.arguments[0]; + } else { + userString = JSON.encode(call.arguments[0]); + } + print(userString); + String card = call.arguments[1]; print('$userString, $card'); var route = new MaterialPageRoute(