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

Flutter SDK for integrating Pasby authentication flows in mobile apps.

example/lib/main.dart

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

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

class PasbyExampleApp extends StatelessWidget {
  const PasbyExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Pasby Example')),
        body: const _Home(),
      ),
    );
  }
}

class _Home extends StatelessWidget {
  const _Home();

  @override
  Widget build(BuildContext context) {
    final server = PasbyAuthWithServerFunctions(
      baseUrl: 'https://api.example.com',
      paths: Paths(
        '/pasby/auth',
        '/pasby/cancel',
        '/pasby/ping',
        '/pasby/wildcard',
      ),
    );

    return Padding(
      padding: const EdgeInsets.all(16),
      child: AuthenticateDifferentDevice(
        server: server,
        payload: 'signed-jwt-or-session-payload',
        onSuccessful: (result) async {
          debugPrint('Pasby auth success for user: ${result.user}');
        },
        onFailed: (error) {
          debugPrint('Pasby auth failed: $error');
        },
      ),
    );
  }
}
1
likes
70
points
5
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for integrating Pasby authentication flows in mobile apps.

Homepage

Topics

#authentication #identity #flutter

License

MIT (license)

Dependencies

blur, dio, flutter, flutter_hooks, flutter_riverpod, flutter_svg, getwidget, hooks_riverpod, logger, modal_bottom_sheet, qr_flutter, sizer

More

Packages that depend on pasby