octopod 0.1.3 copy "octopod: ^0.1.3" to clipboard
octopod: ^0.1.3 copied to clipboard

This package provides a handy tool for interacting with the Octopus Energy REST API.

Octopod #

This package provides a handy tool for interacting with the Octopus Energy REST API.

This is still in the early stages of development and as such, currently provides only basic functionality (Currently only getProducts and getAccount are supported).

Installation #

Add the following line to your pubspec.yaml file:

dependencies:
  octopod: ^0.1.3

Usage #

import 'package:flutter/material.dart';
import 'package:octopod/octopod.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _octopod = Octopod(apiKey: '<api-key>');

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: () async => await _octopod.getProducts(),
          child: const Text('Get Products'),
        ),
      ),
    );
  }
}

1
likes
140
points
32
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

This package provides a handy tool for interacting with the Octopus Energy REST API.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter, freezed_annotation, json_annotation

More

Packages that depend on octopod