Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Files

Latest commit

eea17c9 · Feb 17, 2023

History

History

ios_platform_images

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 17, 2023
Feb 17, 2023
Jan 25, 2023
Feb 17, 2023
Dec 12, 2019
Mar 18, 2021
Feb 17, 2023
Mar 19, 2021
Feb 17, 2023
Feb 17, 2023

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 11.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];
}