trak 1.0.0 copy "trak: ^1.0.0" to clipboard
trak: ^1.0.0 copied to clipboard

A simple framework to use when tracking things.

example/example.dart

import 'dart:io';

import 'package:collection/collection.dart';
import 'package:trak/trak.dart';

void main() {
  final exampleList = [
    Entry(
      timestamp: DateTime(2023, 1, 15, 12, 30, 55),
      rating: 0.5,
      associates: const [
        'Jogging',
        'Good sleep',
      ],
    ),
    Entry(
      timestamp: DateTime(2023, 1, 16, 6, 15, 30),
      rating: 0.8,
      associates: const [
        'Work',
        'Bad sleep',
      ],
    ),
  ];

  final serialized = exampleList.toJson();
  stdout.writeln(serialized);

  final deserialized = entryListFromJson(serialized);
  final isEqual = const ListEquality<Entry>().equals(exampleList, deserialized);
  stdout.writeln('Contents are equal: $isEqual');
}
0
likes
150
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A simple framework to use when tracking things.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

collection, meta

More

Packages that depend on trak