Menu in iOS

This commit is contained in:
Ivan Murashov
2018-05-20 13:44:15 +03:00
parent 23a3bf1a9c
commit d9400a3df9
34 changed files with 317 additions and 1218 deletions

View File

@@ -48,7 +48,7 @@ FLUTTER_EXPORT
On the Dart side, messages are represented using `ByteData`.
*/
FLUTTER_EXPORT
@interface FlutterBinaryCodec : NSObject<FlutterMessageCodec>
@interface FlutterBinaryCodec : NSObject <FlutterMessageCodec>
@end
/**
@@ -59,7 +59,7 @@ FLUTTER_EXPORT
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
*/
FLUTTER_EXPORT
@interface FlutterStringCodec : NSObject<FlutterMessageCodec>
@interface FlutterStringCodec : NSObject <FlutterMessageCodec>
@end
/**
@@ -77,7 +77,57 @@ FLUTTER_EXPORT
package.
*/
FLUTTER_EXPORT
@interface FlutterJSONMessageCodec : NSObject<FlutterMessageCodec>
@interface FlutterJSONMessageCodec : NSObject <FlutterMessageCodec>
@end
/**
A writer of the Flutter standard binary encoding.
See `FlutterStandardMessageCodec` for details on the encoding.
The encoding is extensible via subclasses overriding `writeValue`.
*/
FLUTTER_EXPORT
@interface FlutterStandardWriter : NSObject
- (instancetype)initWithData:(NSMutableData*)data;
- (void)writeByte:(UInt8)value;
- (void)writeBytes:(const void*)bytes length:(NSUInteger)length;
- (void)writeData:(NSData*)data;
- (void)writeSize:(UInt32)size;
- (void)writeAlignment:(UInt8)alignment;
- (void)writeUTF8:(NSString*)value;
- (void)writeValue:(id)value;
@end
/**
A reader of the Flutter standard binary encoding.
See `FlutterStandardMessageCodec` for details on the encoding.
The encoding is extensible via subclasses overriding `readValueOfType`.
*/
FLUTTER_EXPORT
@interface FlutterStandardReader : NSObject
- (instancetype)initWithData:(NSData*)data;
- (BOOL)hasMore;
- (UInt8)readByte;
- (void)readBytes:(void*)destination length:(NSUInteger)length;
- (NSData*)readData:(NSUInteger)length;
- (UInt32)readSize;
- (void)readAlignment:(UInt8)alignment;
- (NSString*)readUTF8;
- (id)readValue;
- (id)readValueOfType:(UInt8)type;
@end
/**
A factory of compatible reader/writer instances using the Flutter standard
binary encoding or extensions thereof.
*/
FLUTTER_EXPORT
@interface FlutterStandardReaderWriter : NSObject
- (FlutterStandardWriter*)writerWithData:(NSMutableData*)data;
- (FlutterStandardReader*)readerWithData:(NSData*)data;
@end
/**
@@ -113,7 +163,8 @@ FLUTTER_EXPORT
instead.
*/
FLUTTER_EXPORT
@interface FlutterStandardMessageCodec : NSObject<FlutterMessageCodec>
@interface FlutterStandardMessageCodec : NSObject <FlutterMessageCodec>
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
@end
/**
@@ -359,7 +410,7 @@ FLUTTER_EXPORT
those supported as top-level or leaf values by `FlutterJSONMessageCodec`.
*/
FLUTTER_EXPORT
@interface FlutterJSONMethodCodec : NSObject<FlutterMethodCodec>
@interface FlutterJSONMethodCodec : NSObject <FlutterMethodCodec>
@end
/**
@@ -373,7 +424,8 @@ FLUTTER_EXPORT
`FlutterStandardMessageCodec`.
*/
FLUTTER_EXPORT
@interface FlutterStandardMethodCodec : NSObject<FlutterMethodCodec>
@interface FlutterStandardMethodCodec : NSObject <FlutterMethodCodec>
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
@end
NS_ASSUME_NONNULL_END

View File

@@ -23,6 +23,26 @@ FLUTTER_EXPORT
- (instancetype)initFromDefaultSourceForConfiguration;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
+ (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
+ (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
@end
#endif // FLUTTER_FLUTTERDARTPROJECT_H_

View File

@@ -183,6 +183,26 @@ NS_ASSUME_NONNULL_BEGIN
- Parameters delegate: The receiving object, such as the plugin's main class.
*/
- (void)addApplicationDelegate:(NSObject<FlutterPlugin>*)delegate;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
@end
/**

View File

@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
FLUTTER_EXPORT
@protocol FlutterTexture<NSObject>
- (CVPixelBufferRef)copyPixelBuffer;
- (CVPixelBufferRef _Nullable)copyPixelBuffer;
@end
FLUTTER_EXPORT

View File

@@ -22,6 +22,26 @@ FLUTTER_EXPORT
- (void)handleStatusBarTouches:(UIEvent*)event;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
/**
Sets the first route that the Flutter app shows. The default is "/".