homeconnect_flutter 0.1.0 copy "homeconnect_flutter: ^0.1.0" to clipboard
homeconnect_flutter: ^0.1.0 copied to clipboard

Flutter utility classes, meant to be used with the home connect SDK

Home Connect Futter #

The Home Connect Flutter package contains utilities for oauth and storage management that can be used in your Flutter app.

Usage #

import 'package:homeconnect_flutter/homeconnect_flutter.dart';

Future<void> main() async {

  final prefs = await SharedPreferences.getInstance();
  final api =
          credentials: HomeConnectClientCredentials(
            clientId: env["HOMECONNECT_CLIENT_ID"]!,
            redirectUri: env["HOMECONNECT_REDIRECT_URL"]!, // redirectUrl,
          authenticator: null,
          // pass storage to handle refresh tokens
          storage: SharedPreferencesHomeConnectAuthStorage(

    // ... in you widget run the authorize function to start the oauth webview flow
        onPressed: () async {
            await homeconnectApi.authenticate();