memory_image_converter 0.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 55

memory_image_converter

A command line app that will convert an image into a Uint8List which can be consumed by a Flutter app using the MemoryImage, Image.memory, or FadeInImage.memoryNetwork classes.

Installation

In your terminal:

pub global activate memory_image_converter 

Usage

This command-line tool takes two arguments:

  1. The name of the variable you wish to define
  2. The path to the image you wish to convert
pub global run memory_image_converter myImage test.png

Write the output to a dart file

pub global run memory_image_converter myImage test.png > my_image.dart

Once more, with pub-cache in your $PATH

memory_image_converter myImage test.png > my_image.dart

1.0.0

  • Initial version, allows you to convert images into a Uint8List which can be consumed in Flutter apps.

example/lib/main.dart

import 'package:example/image.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new ListView(
          children: <Widget>[
            Image.memory(myImage),
            new Text('You have pushed the button this many times:'),
            new Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ),
    );
  }
}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate memory_image_converter

2. Use it

The package has the following executables:


$ memory_image_converter
Version Uploaded Documentation Archive
0.0.1 Aug 29, 2018 Go to the documentation of memory_image_converter 0.0.1 Download memory_image_converter 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
14
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0