hydrawise 0.0.1 copy "hydrawise: ^0.0.1" to clipboard
hydrawise: ^0.0.1 copied to clipboard

Unopinionated models for use in a program that interacts with the Hydrawise API.

example/main.dart

import 'dart:convert';

import 'package:hydrawise/hydrawise.dart';

void main() {
  final customer = HCustomerDetails(
    activeControllerId: 1,
    customerId: 1,
    controllers: [
      HydrawiseController(
        name: 'My Controller',
        lastContact: DateTime.now().millisecondsSinceEpoch,
        serialNumber: '12345',
        id: 1,
        status: 'All good!',
      ),
    ],
  );

  final json = customer.toJson();
  print(jsonEncode(json));

  // {"controller_id":1,"customer_id":1,"controllers":[{"name":"My Controller","last_contact":1660151429700,"serial_number":"12345","controller_id":1,"status":"All good!"}]}
}
2
likes
120
pub points
0%
popularity

Publisher

verified publisherbrandontrautmann.com

Unopinionated models for use in a program that interacts with the Hydrawise API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

freezed_annotation

More

Packages that depend on hydrawise