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

Package for interacting with 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 is supported).

Installation #

Add the following line to your pubspec.yaml file:

dependencies:
  octopod: ^0.0.1

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
0
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

Package for interacting with Octopus Energy REST API.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, freezed_annotation, json_annotation

More

Packages that depend on octopod