From 96f045f7dc5a3a68b97fa1a19de4e61af5468509 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Mon, 23 Jan 2023 00:46:52 +0900 Subject: [PATCH 1/2] add Dart initialize on yaml file --- apps/docs/docs/ref/dart/initializing.mdx | 50 ------------------------ spec/supabase_dart_v1.yml | 35 +++++++++++++++++ 2 files changed, 35 insertions(+), 50 deletions(-) delete mode 100644 apps/docs/docs/ref/dart/initializing.mdx diff --git a/apps/docs/docs/ref/dart/initializing.mdx b/apps/docs/docs/ref/dart/initializing.mdx deleted file mode 100644 index 501efaef48f..00000000000 --- a/apps/docs/docs/ref/dart/initializing.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: initializing -title: 'Initializing' -slug: initializing ---- - - - - - Initialize Supabase with the static `initialize()` method on `Supabase` class. - - - - - - - - - ```dart main.dart - Future main() async { - WidgetsFlutterBinding.ensureInitialized(); - - await Supabase.initialize( - url: 'https://xyzcompany.supabase.co', - anonKey: 'public-anon-key', - ); - - runApp(MyApp()); - } - ``` - - - - - ```dart - final supabase = SupabaseClient( - 'https://xyzcompany.supabase.co', - 'public-anon-key', - ); - ``` - - - - - - diff --git a/spec/supabase_dart_v1.yml b/spec/supabase_dart_v1.yml index 333147b6b49..72e079bb08b 100644 --- a/spec/supabase_dart_v1.yml +++ b/spec/supabase_dart_v1.yml @@ -16,6 +16,41 @@ info: version: '0.0.1' functions: + - id: initializing + title: 'Initializing' + $ref: '@supabase/supabase-js.index.SupabaseClient.constructor' + description: | + You can initialize Supabase with the static `initialize()` method of `Supabase` class. + + The Supabase client is your entrypoint to the rest of the Supabase functionality + and is the easiest way to interact with everything we offer within the Supabase ecosystem. + + examples: + - id: flutter-initialize + name: For Flutter + code: | + ```dart + Future main() async { + await Supabase.initialize( + url: 'https://xyzcompany.supabase.co', + anonKey: 'public-anon-key', + ); + + runApp(MyApp()); + } + + // Get a reference your Supabase client + final supabase = Supabase.instance.client; + ``` + - id: for-other-dart-projects + name: For other Dart projects + code: | + ```dart + final supabase = SupabaseClient( + 'https://xyzcompany.supabase.co', + 'public-anon-key', + ); + ``` - id: sign-up title: 'signUp()' description: | From 197f9bfcd5666a7fcaec5facbd72fc4240c2a8e7 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Mon, 23 Jan 2023 00:51:25 +0900 Subject: [PATCH 2/2] hide misc on Flutter docs --- spec/common-client-libs-sections.json | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json index 517dad7a6fa..d8a51532a7a 100644 --- a/spec/common-client-libs-sections.json +++ b/spec/common-client-libs-sections.json @@ -847,6 +847,7 @@ }, { "title": "Misc", + "excludes": ["reference_dart_v1", "reference_dart_v0"], "items": [ {