tempcord_data_interface 1.1.0 copy "tempcord_data_interface: ^1.1.0" to clipboard
tempcord_data_interface: ^1.1.0 copied to clipboard

Standarized profile and body temperature record object model for Tempcord.

example/example.dart

import 'package:tempcord_data_interface/interface.dart';
import 'package:tempcord_data_interface/type.dart';

// Example implementation of profile
class ExampleProfile implements Profile {
  @override
  final String name;

  @override
  final Animal animal;

  // Additional field depending what you needed
  final int age;

  ExampleProfile(this.name, this.animal, this.age);

  @override
  ExampleProfile updateAnimal(Animal animal) =>
      ExampleProfile(this.name, animal, this.age);

  @override
  ExampleProfile updateName(String name) =>
      ExampleProfile(name, this.animal, this.age);

  // Also provide update method for each additional field

  ExampleProfile updateAge(int age) =>
      ExampleProfile(this.name, this.animal, age);
}

class ExampleBodyTemperatureRecordNode implements BodyTemperatureRecordNode {
  @override
  final DateTime recordedAt;

  @override
  final Temperature temperature;

  // Additional field here

  ExampleBodyTemperatureRecordNode(this.temperature, this.recordedAt);
}
0
likes
120
pub points
15%
popularity

Publisher

verified publisherrk0cc.xyz

Standarized profile and body temperature record object model for Tempcord.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

meta, quiver

More

Packages that depend on tempcord_data_interface