fiction_social_auth 0.0.1 copy "fiction_social_auth: ^0.0.1" to clipboard
fiction_social_auth: ^0.0.1 copied to clipboard

Flutter package to handle social auth

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text("Fiction Social Auth")),
        body: SizedBox(
          width: MediaQuery.of(context).size.width,
          child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                ElevatedButton(
                  onPressed: () async {
                    FictionSocialAuth socialAuth = FictionSocialAuth();
                    UserData? user =
                        await socialAuth.socialAuth(AuthType.google);
                    print("UserData: ${user?.toJson()}");
                  },
                  child: Text("Google"),
                ),
                const SizedBox(
                  height: 10,
                ),
                ElevatedButton(
                  onPressed: () async {
                    FictionSocialAuth socialAuth = FictionSocialAuth();
                    UserData? user =
                        await socialAuth.socialAuth(AuthType.github);
                    print("UserData: ${user?.toJson()}");
                  },
                  child: Text("Github"),
                ),
                const SizedBox(
                  height: 10,
                ),
                ElevatedButton(
                  onPressed: () async {
                    FictionSocialAuth socialAuth = FictionSocialAuth();
                    UserData? user =
                        await socialAuth.socialAuth(AuthType.linkedin);
                    print("UserData: ${user?.toJson()}");
                  },
                  child: Text("LinkedIn"),
                ),
              ]),
        ),
      ),
    );
  }
}
3
likes
110
points
35
downloads

Documentation

API reference

Publisher

verified publisherfictiondevelopers.com

Weekly Downloads

Flutter package to handle social auth

Homepage

License

MIT (license)

Dependencies

flutter, flutter_web_auth_2

More

Packages that depend on fiction_social_auth