dropzone_angular_dart 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 4

dropzone_angular_dart

Dropzone for Angular Dart.

Demo/Docs

Setup

pubspec.yaml:

dependencies:
  dropzone_angular_dart: 

HTML:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.css" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.js"></script>

Dart:

import 'package:dropzone_angular_dart/dropzone_angular_dart.dart';

Usage

HTML:

<div (dropzone)="initDropzone($event)" [config]="dropzoneConfiguration" class="dropzone"></div>

<p *ngIf="uploadedFile != null">
    Uploaded file type = {{ uploadedFile.type }}<br/>
    Uploaded file size = {{ uploadedFile.size | number }}<br/>
    Upload response = {{ uploadResponse }}<br/>
</p>

Dart:

import 'dart:html';

import 'package:angular2/core.dart';
import 'package:dropzone_angular_dart/dropzone_angular_dart.dart';

@Component(
    selector: 'my-app',
    styleUrls: const ['AppComponent.css'],
    templateUrl: 'AppComponent.html',
    directives: const [DROPZONE_DIRECTIVES])
class AppComponent {

  DropzoneConfiguration dropzoneConfiguration = new DropzoneConfiguration(
      url: 'http://localhost:8081/upload', addRemoveLinks: true, maxFiles: 1);
  Dropzone dropzone;
  Blob uploadedFile = null;
  String uploadResponse = null;
  NgZone zone;

  AppComponent(this.zone);

  void initDropzone(Dropzone dropzone) {
    this.dropzone = dropzone;
    this.dropzone.on("success", success);
  }

  void success(Blob file, String response, Event event) {
    print('success(' + file.toString() + ", " + response + ", " +
        event.toString() + ")");
    zone.run(() {
      uploadedFile = file;
      uploadResponse = response;
    });
  }
}

Changelog

0.2.0

  • Upgraded angular2 dependency to 3.x

0.1.0

  • Initial version.

Use this package as a library

1. Depend on it

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


dependencies:
  dropzone_angular_dart: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dropzone_angular_dart/dropzone_angular_dart.dart';
  
Version Uploaded Documentation Archive
0.2.0 May 24, 2017 Go to the documentation of dropzone_angular_dart 0.2.0 Download dropzone_angular_dart 0.2.0 archive
0.1.0 Nov 20, 2016 Go to the documentation of dropzone_angular_dart 0.1.0 Download dropzone_angular_dart 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
8
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
4
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

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