datakick_sdk 0.2.3

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

DataKick SDK

SDK to interface with datakick.com

There are 3 constructors

///Default product
product();
///empty product
product.empty();
///product with just the food parameters
product.food();

Getting, setting and updating product info is easy

///create an object
Product product = new Product.empty();

/// Then pass a barcode to the object and wait for the future
product.getBarcode("00000000000000").then((product) {
    ///Now you can work with your product here...

    // change the name of the product
    product.name = "new name";
    product.update();
}

You can store a list of products in a productmap object as well.

///Datakick will retrieve 100 products at a time.
dataKickList(dkl).then(expectAsync1((ProductMap pro3) {
  ///Calling this recursively will grow the list by 100
  ///products at a time.
  dataKickList(pro3).then(expectAsync1((ProductMap pro4) {
    /// list would now have 200 entries.
  }));
}));

package Road map:

  • Initial commit contains just enough to:
    • Get by barcode
    • Update products
    • create products
    • list products (100 at a time. Resubmit the product back to the list function to grow it by the next 100 products)

TODO:

  • Add functionality for camera plugin to create a widget (v0.3.0)
  • Add functionality for adding images (v1.0.0)
  • Add functionality for updating or modifying images (version undetermined)
  • Add functionality for image removal (version undetermined)
  • Add functionality for image data parsing through ML/AI (v2.0.0)

[0.2.3] - 11/18/2018

Added Dart documentation because my score dropped 9.75 points :(

[0.2.2] - 11/18/2018

It is clearly too early for me to be making commits...

corrected readme, removed extra readme, corrected versioning, and got a cup of coffee...

[0.2.1] - 11/18/2018

updated road map on readme General housekeeping.

[0.2.0] - 11/18/2018

Breaking change on pre-release update no longer needs a parameter. gtin14 is now returned with the object. minor changes Correctly commented Example Lots of updates in the readme so that it is actually useful.

Data kick SDK to interface with

DataKick Product database

[0.1.1] - 11/15/2018

Data kick SDK to interface with DataKick Product database

Added Example Directory

[0.1.0] - 11/15/2018

Data kick SDK to interface with DataKick Product database

Ran analysis on package and fixed for scoring.

[0.0.1] - 11/15/2018

initial commit

Data kick SDK to interface with DataKick Product database

  • Initial commit contains just enough to:
    • Get by barcode
    • Update products
    • create products
    • list products (100 at a time. Resubmit the product back to the list function to grow it by the next 100 products)

TODO:

  • Add functionality for adding updating modifying images
  • Add functionality for image removal
  • Add functionality for image data parsing through ML/AI
  • Add functionality for camera plugin to create a widget

example/lib/example.dart

import 'dart:async';

import 'package:barcode_scan/barcode_scan.dart';
import 'package:datakick_sdk/datakick_sdk.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//Added for barcode scanning
//Package to be added


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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'DATAKICK SDK EXAMPLE',
      theme: new ThemeData(
        primaryColor: Colors.black,
      ),
      home: BarcodeScan(),
    );
  }
}

class BarcodeScan extends StatefulWidget {
  @override
  BarcodeScannerState createState() => new BarcodeScannerState();
}

class BarcodeScannerState extends State<BarcodeScan> {
  String barcode = "";
  String dataKick = "";

  @override
  initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('Add to inventory'),
        ),
        body: new Center(
          child: new Column(
            children: <Widget>[
              new Container(
                child: new MaterialButton(
                    onPressed: scan, child: new Text("Scan")),
                padding: const EdgeInsets.all(8.0),
              ),
              new Text(dataKick),
              new Text(barcode)
            ],
          ),
        ));
  }

  Future scan() async {
    try {
      String barcode = await BarcodeScanner.scan();
      setState(() => this.barcode = barcode);
    } on PlatformException catch (e) {
      if (e.code == BarcodeScanner.CameraAccessDenied) {
        setState(() {
          this.barcode = 'The user did not grant the camera permission!';
        });
      } else {
        setState(() => this.barcode = 'Unknown error: $e');
      }
    } on FormatException {
      setState(() => this.barcode =
          'null (User returned using the "back"-button before scanning anything. Result)');
    } catch (e) {
      setState(() => this.barcode = 'Unknown error: $e');
    }
    //lookup barcode
    Product product = new Product.empty();
    product.getBarcode(this.barcode).then((product) {
      setState(() => dataKick = product.brand_name.toString());
    });
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  datakick_sdk: ^0.2.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:datakick_sdk/datakick_sdk.dart';
  
Version Uploaded Documentation Archive
0.2.3 Nov 28, 2018 Go to the documentation of datakick_sdk 0.2.3 Download datakick_sdk 0.2.3 archive
0.2.2 Nov 18, 2018 Go to the documentation of datakick_sdk 0.2.2 Download datakick_sdk 0.2.2 archive
0.2.1 Nov 18, 2018 Go to the documentation of datakick_sdk 0.2.1 Download datakick_sdk 0.2.1 archive
0.2.0 Nov 18, 2018 Go to the documentation of datakick_sdk 0.2.0 Download datakick_sdk 0.2.0 archive
0.1.1 Nov 17, 2018 Go to the documentation of datakick_sdk 0.1.1 Download datakick_sdk 0.1.1 archive
0.1.0 Nov 15, 2018 Go to the documentation of datakick_sdk 0.1.0 Download datakick_sdk 0.1.0 archive
0.0.1 Nov 15, 2018 Go to the documentation of datakick_sdk 0.0.1 Download datakick_sdk 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
7
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
camera ^0.2.4 0.2.6
convert ^2.0.2 2.0.2
firebase_ml_vision ^0.2.0+1 0.2.0+2
flutter 0.0.0
html ^0.13.3+3 0.13.3+3
http ^0.11.3+17 0.11.3+17 0.12.0
json_annotation ^2.0.0 2.0.0
Transitive dependencies
args 1.5.1
async 2.0.8
charcode 1.1.2
collection 1.14.11
csslib 0.14.6
http_parser 3.1.3
logging 0.11.3+2
meta 1.1.6
path 1.6.2
sky_engine 0.0.99
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
vector_math 2.0.8
Dev dependencies
barcode_scan ^0.0.3
build_runner ^1.0.0
flutter_test
json_serializable ^2.0.0
test any