dent 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new60

Github Actions CI

Overview #

Dent aims to give data layer for Dart developers writing ecommerce or other applications. Dent is used by Dint.

The classes are:

  • Immutable. They use built_value.
  • Serializable. The classes use built_value serialization.
  • Database friendly. We have an integration with the package datastore. Mapping to a relational database model would be simple too.

The goal is that this package will help developers to:

  • Save time. All you need to do is to connect to some database supported by the package datastore.
  • Reduce defects. A data layer audited by more teams than just your own is likely to contain less defects when it comes to database modeling, programming, security, or regulatory compliance.
  • Interoperability. You can take advantage of possible future open-source/commercial packages that are compatible with the data layer.

Examples #

Identity #

  • Account
  • Organization
  • Person
  • PersonName

Business #

  • Product
  • ShoppingCart
  • ShoppingCartItem
  • ShoppingTransaction

World #

  • Place

Contributing #

If you are doing major changes, it might be a good idea to first create an issue in the issue tracker and explain your plan. If you just fix something or add a small relevant feature, just go ahead!

This is how you contribute:

  1. Fork github.com/dint-dev/dent by pressing fork button.
  2. Clone your fork to your computer: git clone github.com/your_username/dent
  3. Do your changes. When you are done, commit changes with git add -A and git commit.
  4. Push changes to your personal repository: git push origin
  5. Go to github.com/dint-dev/dent and create a pull request.

Contributors may be added to the Github organization team so they can save time by pushing directly to the repository.

[0.1.0] - January 12, 2020

  • Initial release

example/example.dart

import 'package:dent/business.dart';
import 'package:dent/core.dart';

Future main() async {
  final product = Product(
    title: Text('Phone'),
    description: Text('A new phone'),
    price: Money.usd(300),
  );

  // Mutate
  final newProduct = product.rebuild((b) {
    b.price += Money.usd(50);
  });

  // Print
  print(newProduct.toString());
}

Use this package as a library

1. Depend on it

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


dependencies:
  dent: ^0.1.0

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

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

  • Dart: 2.7.0
  • pana: 0.13.4

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (datastore).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
args ^1.5.0 1.5.2
built_collection ^4.3.2 4.3.2
built_value ^7.0.0 7.0.8
collection ^1.10.0 1.14.12
datastore ^0.1.3 0.1.3 0.2.0
meta ^1.1.0 1.1.8
Transitive dependencies
_discoveryapis_commons 0.1.9
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
async 2.4.0
boolean_selector 1.0.5
charcode 1.1.2
convert 2.1.1
coverage 0.13.3+3
crypto 2.1.4
csslib 0.16.1
firebase 7.2.0
fixnum 0.10.11
glob 1.2.0
googleapis 0.54.0
googleapis_auth 0.2.11+1
grpc 2.1.3
html 0.14.0+3
http 0.12.0+4
http2 1.0.0
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
logging 0.11.4
matcher 0.12.6
mime 0.9.6+3
multi_server_socket 1.0.2
node_interop 1.0.3
node_io 1.0.1+2
node_preamble 1.4.8
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
petitparser 3.0.0
pool 1.4.0
protobuf 1.0.1
pub_semver 1.4.2
quiver 2.1.2+1
shelf 0.7.5
shelf_packages_handler 1.0.4
shelf_static 0.2.8
shelf_web_socket 0.2.3
source_map_stack_trace 1.1.5
source_maps 0.10.8
source_span 1.6.0
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.13
test_core 0.2.18
test_io 0.1.1
typed_data 1.1.6
universal_html 1.1.12
universal_io 0.8.6
vm_service 2.3.1
watcher 0.9.7+13
web_socket_channel 1.1.0
xml 3.7.0
yaml 2.2.0
zone_local 0.1.2
Dev dependencies
build_runner ^1.0.0
build_test ^0.10.0
built_value_generator ^7.0.0
pedantic ^1.8.0 1.9.0
test ^1.8.0 1.11.1