testik 0.0.2

  • Readme
  • Changelog
  • Installing
  • 42

Dart Immutable Data Class Builder #

Example Model

import 'package:testik/testik.dart';

part 'models.g.dart';

abstract class User implements _$User {
  factory User(String name, int age, String weight) = _$User$._;

abstract class Animal implements _$Animal {
  factory Animal(String name) = _$Animal$._;

abstract class Home implements _$Home {
  factory Home(User owner, Animal cat) = _$Home$._;

abstract class Shelter implements _$Shelter {
  factory Shelter(Animal dog, {Animal cat, Animal mouse}) = _$Shelter$._;

Example Usage

void main() {
  // Properties
  var user = User("Joe Doe", 33, "OK");
  assert(user.name == "Joe Doe");
  assert(user.age == 33);
  assert(user.weight == "OK"); 

  // Equals
  var animal = Animal("Dog");
  assert(animal.name == "Dog");
  assert(Animal("Dog") == Animal("Dog"));  

  // Named parameters
  var shelter = Shelter(Animal("doggo"), cat: Animal("Tom"), mouse: Animal("Jerry"));

Changelog #

0.0.2 #

  • Add equals, teString and hashCode implementations
  • Support named paramters

0.0.1 #

  • Initial version.

Use this package as a library

1. Depend on it

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

  testik: ^0.0.2

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

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

  • Dart: 2.6.0
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:testik/testik.dart.

Health suggestions

Format lib/testik.dart.

Run dartfmt to format lib/testik.dart.

Maintenance suggestions

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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and testik.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
testik_generator >=0.0.2 <0.1.0 0.0.2
Transitive dependencies
analyzer 0.36.4 0.39.1
args 1.5.2
async 2.4.0
build 1.2.2
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
dart_style 1.2.9 1.3.3
front_end 0.1.19 0.1.29
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
kernel 0.3.19 0.3.29
logging 0.11.3+2
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pub_semver 1.4.2
source_gen 0.9.4+4 0.9.4+6
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+12
yaml 2.2.0
Dev dependencies
pedantic ^1.4.0 1.8.0+1
test ^1.0.0