[platform_channels] adds iOS implementation for platform image demo ()

pull/577/head
Ayush Bherwani 4 years ago committed by GitHub
parent 0188371865
commit ed73e7a310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,6 +26,19 @@ import Flutter
}
})
FlutterBasicMessageChannel(name: "platformImageDemo", binaryMessenger: flutterViewController.binaryMessenger, codec: FlutterStandardMessageCodec.sharedInstance()).setMessageHandler{
(message: Any?, reply: FlutterReply) -> Void in
if(message as! String == "getImage") {
guard let image = UIImage(named: "eat_new_orleans.jpg") else {
reply(nil)
return
}
reply(FlutterStandardTypedData(bytes: image.jpegData(compressionQuality: 1)!))
}
}
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "eat_new_orleans.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Loading…
Cancel
Save