nutrientfacts 0.0.7

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

nutrientfacts #

Widget to render Nutrition Facts labels

nutrientfacts

Featuring: #

  • Full Nutrition Facts label rendering
  • Automatic missing values handling
  • Automatic Daily Value % calculation

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.0.7]

  • Added support for Dart 2

[0.0.6]

  • Meta data nutrient infromation moved to MetaDataNutrient class

[0.0.4]

  • Fully operational Widget

[0.0.1]

  • Initual layout made

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:nutrientfacts/nutrientfacts.dart';

final nutrientData = {
  "CA": {"amount": 37.5, "unit": "mg"},
  "CHOCDF": {"amount": 342.1, "unit": "g"},
  "CHOLE": {"amount": 16.561, "unit": "mg"},
  "ENERC_KCAL": {"amount": 2135.9, "unit": "kcal"},
  "FAT": {"amount": 67.51, "unit": "g"},
  "FE": {"amount": 18.2, "unit": "mg"},
  "FIBTG": {"amount": 12.90, "unit": "g"},
  "FOLAC": {"amount": 385.0, "unit": "mcg"},
  "K": {"amount": 676.7, "unit": "mg"},
  "MG": {"amount": 133.07, "unit": "mg"},
  "NA": {"amount": 1038.89, "unit": "mg"},
  "NIA": {"amount": 19.49, "unit": "mg"},
  "P": {"amount": 381.19, "unit": "mg"},
  "PROCNT": {"amount": 35.99, "unit": "g"},
  "RIBF": {"amount": 1.6, "unit": "mg"},
  "SE": {"amount": 84.75, "unit": "mcg"},
  "SUGAR": {"amount": 74.49, "unit": "g"},
  "THIA": {"amount": 2.74, "unit": "mg"},
  "VITA_IU": {"amount": 5.0, "unit": "IU"},
  "VITB6A": {"amount": 0.11, "unit": "mg"},
  "VITD": {"amount": 28.39, "unit": "IU"},
  "VITK1": {"amount": 0.75, "unit": "mcg"},
  "ZN": {"amount": 2.93, "unit": "mg"},
  "SATFAT": {"amount": 4.2, "unit": "g"},
  "TRANSFAT": {"amount": 4.2, "unit": "g"},
  "FIBER": {"amount": 4.23456, "unit": "g"},
};

void main() {
  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    theme: ThemeData.light(),
    title: "Nutritional Facts!",
    home: NutritionFacts(nutrientData: nutrientData),
  ));
}

Use this package as a library

1. Depend on it

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


dependencies:
  nutrientfacts: ^0.0.7

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:nutrientfacts/nutrientfacts.dart';
  
Version Uploaded Documentation Archive
0.0.7 Aug 14, 2018 Go to the documentation of nutrientfacts 0.0.7 Download nutrientfacts 0.0.7 archive
0.0.6 Aug 3, 2018 Go to the documentation of nutrientfacts 0.0.6 Download nutrientfacts 0.0.6 archive
0.0.5 Jul 25, 2018 Go to the documentation of nutrientfacts 0.0.5 Download nutrientfacts 0.0.5 archive
0.0.4 Jul 25, 2018 Go to the documentation of nutrientfacts 0.0.4 Download nutrientfacts 0.0.4 archive
0.0.3 Jul 25, 2018 Go to the documentation of nutrientfacts 0.0.3 Download nutrientfacts 0.0.3 archive
0.0.2 Jul 24, 2018 Go to the documentation of nutrientfacts 0.0.2 Download nutrientfacts 0.0.2 archive
0.0.1 Jul 23, 2018 Go to the documentation of nutrientfacts 0.0.1 Download nutrientfacts 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
4
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
68
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/nutrientfacts.dart. (-3.45 points)

Analysis of lib/nutrientfacts.dart reported 7 hints, including:

line 196 col 18: Avoid using braces in interpolation when not needed.

line 196 col 24: Avoid using braces in interpolation when not needed.

line 204 col 50: Avoid using braces in interpolation when not needed.

line 244 col 30: Avoid using braces in interpolation when not needed.

line 244 col 36: Avoid using braces in interpolation when not needed.

Maintenance suggestions

The package description is too short. (-17 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.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
carousel_slider ^0.0.6 0.0.7 1.0.1
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test