remote_image_button 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 32

remote_image_button #

Flutter widget to manage an image button UI from a JSON definition

This is a Remote UI plugin.

Usage #

Add the factory to the RemoteManagerWidget:

    parsers: [RemoteImageButtonFactory()],
    child: RemoteWidget(...)

RemoteImageButtonFactory can take a base url provider function, in case you definition contains only /image/on.jpg the base url will be taken from the provider

Then you can provide a JSON representation of a color picker like this:

    'type': 'image_button',
    'id': 'myButton',
    'value': 'on',
    'values': {
      'on': '',
      'off': '',


Image button:

id : id of the widget value : current value, it has to match one of the values entries width : width of the button height: height of the button fit: fit, default to contain (1), see BoxFit for more padding: padding of the button, see EdgeInsets definition values: map of possible value

[0.0.4] - 26/03/2020. #

  • update deps.

[0.0.1] - 05/06/2019. #

  • initial release.


import 'package:flutter/material.dart';
import 'package:remote_image_button/remote_image_button.dart';
import 'package:remote_ui/remote_ui.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
      home: MyHomePage(title: 'Flutter Demo Home Page'),

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

  final String title;

  _MyHomePageState createState() => _MyHomePageState();

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

  void _incrementCounter() {
    setState(() {

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
              child: RemoteManagerWidget(
                parsers: [RemoteImageButtonFactory()],
                onChanges: (key, value, {associatedData}) => debugPrint('$key change to $value'),
                child: RemoteWidget(
                  definition: {
                    'type': 'column',
                    'children': [
                        'type': 'image_button',
                        'id': 'myButton',
                        'value': 'on',
                        'values': {
                          'on': '',
                          'off': '',
              'You have pushed the button this many times:',
              style: Theme.of(context).textTheme.display1,
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  remote_image_button: ^0.0.4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:remote_image_button/remote_image_button.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Health issues and suggestions

Fix lib/src/widgets/image_svg_web.dart. (-25 points)

Analysis of lib/src/widgets/image_svg_web.dart failed with 1 error:

line 34 col 10: The name 'platformViewRegistry' is being referenced through the prefix 'ui', but it isn't defined in any of the libraries imported using that prefix.

Document public APIs. (-1 points)

5 out of 5 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/parsers/image_button.dart.

Run flutter format to format lib/src/parsers/image_button.dart.

Format lib/src/remote_image_button.dart.

Run flutter format to format lib/src/remote_image_button.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/widgets/image_button.dart (Run flutter format to format lib/src/widgets/image_button.dart.)
  • lib/src/widgets/image_svg.dart (Run flutter format to format lib/src/widgets/image_svg.dart.)
  • lib/src/widgets/image_svg_base.dart (Run flutter format to format lib/src/widgets/image_svg_base.dart.)
  • lib/src/widgets/image_svg_io.dart (Run flutter format to format lib/src/widgets/image_svg_io.dart.)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (flutter_hooks, flutter_svg).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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

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


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_hooks ^0.6.0 0.6.1 0.10.0
flutter_svg ^0.17.3+1 0.17.4 0.18.0
remote_ui ^0.0.7 0.0.7 0.0.8
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
convert 2.1.1
meta 1.1.8 1.2.0
path_drawing 0.4.1
path_parsing 0.1.4
petitparser 3.0.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
xml 3.7.0 4.2.0
Dev dependencies