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 =
      HomeConnectApi(Uri.parse(env["HOMECONNECT_URL"]!),
          credentials: HomeConnectClientCredentials(
            clientId: env["HOMECONNECT_CLIENT_ID"]!,
            redirectUri: env["HOMECONNECT_REDIRECT_URL"]!, // redirectUrl,
          ),
          authenticator: null,
          // pass storage to handle refresh tokens
          storage: SharedPreferencesHomeConnectAuthStorage(
            prefs,
          ),
      );
}

    // ... in you widget run the authorize function to start the oauth webview flow
    TextButton(
        onPressed: () async {
            await homeconnectApi.authenticate();
        },
    )
1
likes
130
points
140
downloads

Publisher

verified publisherkitchenstories.com

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

eventsource, flutter, homeconnect, http, json_annotation, oauth2, shared_preferences, webview_flutter

More

Packages that depend on homeconnect_flutter