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

A Flutter package to integrate Gmail Single Sign-On (SSO) for Web, Android, iOS, and Desktop platforms

example/main.dart

// import 'package:flutter/material.dart';
// import 'package:flutter_gmail_sso/gmail_sso.dart';

// void main() => runApp(MyApp());

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

//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       home: GmailSignInPage(),
//     );
//   }
// }

// class GmailSignInPage extends StatefulWidget {
//   @override
//   _GmailSignInPageState createState() => _GmailSignInPageState();
// }

// class _GmailSignInPageState extends State<GmailSignInPage> {
//   String? _jwt;

//   @override
//   Widget build(BuildContext context) {
//     return Scaffold(
//       appBar: AppBar(title: Text('Gmail SSO Demo')),
//       body: Center(
//         child: Column(
//           mainAxisAlignment: MainAxisAlignment.center,
//           children: <Widget>[
//             ElevatedButton(
//               onPressed: handleSignIn,
//               child: Text('Sign in with Google'),
//             ),
//             if (_jwt != null)
//               Text('JWT: $_jwt'), // Display JWT if available
//           ],
//         ),
//       ),
//     );
//   }

//   final GmailSSO _gmailSSO = GmailSSO();
//   String? jwtToken;

//   Future<void> handleSignIn() async {
//     final token = await _gmailSSO.signInAndGetJWT(context);
//     if (token != null) {
//       setState(() {
//         jwtToken = token;
//       });
//     } else {
//       setState(() {
//         jwtToken = "Sign-in failed or canceled.";
//       });
//     }
//   }
// }
0
likes
130
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to integrate Gmail Single Sign-On (SSO) for Web, Android, iOS, and Desktop platforms

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_dotenv, flutter_inappwebview, google_sign_in, http, url_launcher

More

Packages that depend on flutter_my_sso