Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.04 KB

File metadata and controls

39 lines (28 loc) · 1.04 KB

iOS Platform Images

A Flutter plugin to share images between Flutter and iOS.

This allows Flutter to load images from Images.xcassets and iOS code to load Flutter images.

When loading images from Image.xcassets the device specific variant is chosen (iOS documentation).

iOS
Support 12.0+

Usage

iOS->Flutter Example

// "flutter" is a resource in Assets.xcassets.
final Image xcassetImage = Image(
  image: IosPlatformImages.load('flutter'),
  semanticLabel: 'Flutter logo',
);

IosPlatformImages.load works similarly to UIImage(named:).

Flutter->iOS Example

import ios_platform_images

func makeImage() -> UIImageView {
    let image = UIImage.flutterImageWithName("assets/foo.png")
    return UIImageView(image: image)
}