The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: add draft docs for flutter auth ui
FatumaAf28b5ee3c217
diff --git a/apps/docs/pages/guides/auth/auth-helpers/flutter-auth-ui.mdx b/apps/docs/pages/guides/auth/auth-helpers/flutter-auth-ui.mdxnew file mode 100644index 00000000000..a4e8d9ab2eb--- /dev/null+++ b/apps/docs/pages/guides/auth/auth-helpers/flutter-auth-ui.mdx@@ -0,0 +1,121 @@+import Layout from '~/layouts/DefaultGuideLayout'++export const meta = {+ id: 'flutter-auth-ui',+ title: 'Flutter Auth UI',+ description: 'Prebuilt, customizable Flutter widgets for authenticating users.',+}++Flutter Auth UI is a Flutter package containing pre-built widgets for authenticating users.+It is unstyled and can match your brand and aesthetic.++<image src="https://raw.githubusercontent.com/supabase-community/flutter-auth-ui/main/assets/supabase_auth_ui.png" />++## Add Flutter Auth UI++Add the latest version of the package [supabase-auth-ui](https://pub.dev/packages/supabase_auth_ui) to pubspec.yaml:++```bash+dependencies:+ flutter:+ sdk: flutter+ supabase_auth_ui: ^0.1.0+2+```++### Initialize the Flutter Auth Package++```bash+import 'package:flutter/material.dart';+import 'package:supabase_auth_ui/supabase_auth_ui.dart';++void main() async {+ await Supabase.initialize(+ url: dotenv.get('SUPABASE_URL'),+ anonKey: dotenv.get('SUPABASE_ANON_KEY'),+ );++ runApp(const MyApp());+}+```++### Email Auth++Use a SupaEmailAuth widget to create an email and password signin and signup form. It also contains a button to toggle to display a forgot password form.++You can pass metadataFields to add additional fields to the form to pass as metadata to Supabase.++```bash+SupaEmailAuth(+ redirectTo: kIsWeb ? null : 'io.mydomain.myapp://callback',+ onSignInComplete: (response) {},+ onSignUpComplete: (response) {},+ metadataFields: [+ MetaDataField(+ prefixIcon: const Icon(Icons.person),+ label: 'Username',+ key: 'username',+ validator: (val) {+ if (val == null || val.isEmpty) {+ return 'Please enter something';+ }+ return null;+ },+ ),+ ],+)+```++### Magic Link Auth++Use SupaMagicAuth widget to create a magic link signIn form.++```bash+SupaMagicAuth(+ redirectUrl: kIsWeb ? null : 'io.supabase.flutter://reset-callback/',+ onSuccess: (Session response) {},+ onError: (error) {},+)+```++### Reset password++Use SupaResetPassword to create a password reset form.++```bash+SupaResetPassword(+ accessToken: supabase.auth.currentSession?.accessToken,+ onSuccess: (UserResponse response) {},+ onError: (error) {},+)+```++### Phone Auth++### Social Auth++The package supports login with [official social providers](../../auth#providers).++Use SupaSocialsAuth to create list of social login buttons.++```bash+SupaSocialsAuth(+ socialProviders: [+ SocialProviders.apple,+ SocialProviders.google,+ ],+ colored: true,+ redirectUrl: kIsWeb+ ? null+ : 'io.supabase.flutter://reset-callback/',+ onSuccess: (Session response) {},+ onError: (error) {},+)+```++### Theming++This package uses plain Flutter components allowing you to control the appearance of the components using your own theme.++export const Page = ({ children }) => <Layout meta={meta} children={children} />++export default Page