Skip to main content

vaultbase_flutter 0.1.4 copy "vaultbase_flutter: ^0.1.4" to clipboard
vaultbase_flutter: ^0.1.4 copied to clipboard

Flutter helpers for the Vaultbase client. Secure token storage, OAuth sign-in and app lifecycle.

example/README.md

Example #

A complete Flutter app on Vaultbase lives in the repository's example/: email and password sign-in with two-factor codes, GitHub sign-in in the system browser, and a list of notes that updates live.

The essentials:

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:vaultbase_flutter/vaultbase_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final vb = Vaultbase('https://api.example.com',
      authStore: kIsWeb ? PrefsAuthStore() : SecureAuthStore());
  await vb.authStore.ready;
  VaultbaseLifecycle(vb);
  runApp(MaterialApp(
    home: StreamBuilder<StoredAuth?>(
      stream: vb.authStore.onChange,
      initialData: vb.authStore.current,
      builder: (context, snap) => snap.data == null
          ? const Text('Sign-in page')
          : const Text('Signed in'),
    ),
  ));
}
0
likes
160
points
842
downloads

Documentation

Documentation
API reference

Publisher

verified publishervaultbase.dev

Weekly Downloads

Flutter helpers for the Vaultbase client. Secure token storage, OAuth sign-in and app lifecycle.

Homepage
Repository (GitHub)
View/report issues

Topics

#backend #database #realtime #authentication

License

MIT (license)

Dependencies

flutter, flutter_secure_storage, flutter_web_auth_2, shared_preferences, vaultbase

More

Packages that depend on vaultbase_flutter