fixed bugs in ios version
This commit is contained in:
Binary file not shown.
@@ -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_
|
||||
|
||||
@@ -34,6 +34,12 @@ FLUTTER_EXPORT
|
||||
// Defaults to window's rootViewController.
|
||||
- (NSObject<FlutterBinaryMessenger>*)binaryMessenger;
|
||||
|
||||
// Can be overriden by subclasses to provide a custom FlutterTextureRegistry,
|
||||
// typically a FlutterViewController, for plugin interop.
|
||||
//
|
||||
// Defaults to window's rootViewController.
|
||||
- (NSObject<FlutterTextureRegistry>*)textures;
|
||||
|
||||
@end
|
||||
|
||||
#endif // FLUTTER_FLUTTERDARTPROJECT_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.
|
||||
*/
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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 <Foundation/Foundation.h>
|
||||
|
||||
#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_
|
||||
@@ -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_
|
||||
|
||||
@@ -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<FlutterBinaryMessenger>*)messenger;
|
||||
|
||||
/**
|
||||
Returns a `FlutterTextureRegistry` for registering textures
|
||||
provided by the plugin.
|
||||
|
||||
- Returns: The texture registry.
|
||||
*/
|
||||
- (NSObject<FlutterTextureRegistry>*)textures;
|
||||
|
||||
/**
|
||||
Publishes a value for external use of the plugin.
|
||||
|
||||
|
||||
29
ios/Flutter/Flutter.framework/Headers/FlutterTexture.h
Normal file
29
ios/Flutter/Flutter.framework/Headers/FlutterTexture.h
Normal file
@@ -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 <CoreMedia/CoreMedia.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "FlutterMacros.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
FLUTTER_EXPORT
|
||||
@protocol FlutterTexture<NSObject>
|
||||
- (CVPixelBufferRef)copyPixelBuffer;
|
||||
@end
|
||||
|
||||
FLUTTER_EXPORT
|
||||
@protocol FlutterTextureRegistry<NSObject>
|
||||
- (int64_t)registerTexture:(NSObject<FlutterTexture>*)texture;
|
||||
- (void)textureFrameAvailable:(int64_t)textureId;
|
||||
- (void)unregisterTexture:(int64_t)textureId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // FLUTTER_FLUTTERTEXTURE_H_
|
||||
@@ -11,9 +11,10 @@
|
||||
#include "FlutterBinaryMessenger.h"
|
||||
#include "FlutterDartProject.h"
|
||||
#include "FlutterMacros.h"
|
||||
#include "FlutterTexture.h"
|
||||
|
||||
FLUTTER_EXPORT
|
||||
@interface FlutterViewController : UIViewController<FlutterBinaryMessenger>
|
||||
@interface FlutterViewController : UIViewController<FlutterBinaryMessenger, FlutterTextureRegistry>
|
||||
|
||||
- (instancetype)initWithProject:(FlutterDartProject*)project
|
||||
nibName:(NSString*)nibNameOrNil
|
||||
|
||||
Reference in New Issue
Block a user