remote_image_button 0.0.1

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:

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': 'http://chittagongit.com/download/17966',
      'off': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQRS1i8ftLBJX74FnwordRN5vQ5IgUy9rjkR1R2ODiBjWZThKoEHA',
    }
}

API #

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.1] - 05/06/2019.

  • initial release.

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  remote_image_button: ^0.0.1

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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
8
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms:

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: The current Flutter SDK version is 1.7.8+hotfix.3.
 
 Because remote_image_button depends on flutter_hooks ^0.5.0 which requires Flutter SDK version >=1.0.0 <1.5.8, version solving failed.

Health suggestions

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.

Format lib/src/widgets/image_button.dart.

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

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

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.

Dependencies

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

Admin