Skip to content

A simple password-less authenticator via Magic-Link using flutter and dart

Notifications You must be signed in to change notification settings

Vishwa-Karthik/PasswordLess-Validator

Repository files navigation

Password Less Validation

A simple Flutter password-less authenticator using Magic Link

Installation

Add Magic_sdk to your pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  magic_sdk: ^0.5.0

Add Dependencies

import 'package:magic_sdk/magic_sdk.dart';

Create SDK instance

Head over to Magic Link to save your public key API. We will call this "TOKEN"

void main()  {
  Magic.instance = Magic('YOUR API TOKEN');
}

Use Stack in the top level and add Magic.instance.relayer to the children of Stack to ensure the best performance.

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Stack(children: [             // Use Stack() here
          MaterialApp(
            title: 'Magic Demo',
            home: const LoginPage(),
          ),
          Magic.instance.relayer // Insert Magic relayer here
        ]));
  }
}

Head over to Flutter Docs to have better insights.

About

A simple password-less authenticator via Magic-Link using flutter and dart

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages