sign_in_with_huawei 0.0.3 copy "sign_in_with_huawei: ^0.0.3" to clipboard
sign_in_with_huawei: ^0.0.3 copied to clipboard

The Flutter plugin for Signing In with HUAWEI ID (on HarmonyOS)

example/lib/main.dart

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

import 'package:sign_in_with_huawei/sign_in_with_huawei.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Future<void> loginWithHuaweiId() async {
    final response = await SignInWithHuawei.instance.authById(
      forceLogin: true,
      state: "any state",
      nonce: "any nonce",
      idTokenAlg: IdTokenSignAlgorithm.PS256,
    );
    print(response);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: loginWithHuaweiId,
            child: const Text('Login With Huawei ID'),
          ),
        ),
      ),
    );
  }
}
0
likes
130
points
26
downloads

Publisher

verified publisherharmonycandies.com

Weekly Downloads

The Flutter plugin for Signing In with HUAWEI ID (on HarmonyOS)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sign_in_with_huawei