tree: 5a6a3a78d9575da2e3b038fc5907300a5329a3a6 [path history] [tgz]
  1. example/
  2. ios/
  3. lib/
  4. test/
  5. .gitignore
  6. AUTHORS
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
packages/ios_platform_images/README.md

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
Support9.0+

Usage

iOS->Flutter Example

// Import package
import 'package:ios_platform_images/ios_platform_images.dart';

Widget build(BuildContext context) {
  return MaterialApp(
    home: Scaffold(
      body: Center(
        child: Image(image: IosPlatformImages.load("flutter")),
      ),
      //..
    ),
  );
}

IosPlatformImages.load functions like [UIImage imageNamed:].

Flutter->iOS Example

#import <ios_platform_images/UIImage+ios_platform_images.h>

static UIImageView* MakeImage() {
  UIImage* image = [UIImage flutterImageWithName:@"assets/foo.png"];
  return [[UIImageView alloc] initWithImage:image];
}