Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-flutter into supabase-community-main

# Conflicts:
#	pubspec.lock
#	pubspec.yaml
  • Loading branch information
sunegg committed May 15, 2022
2 parents 78c5fcc + fc1bc7d commit 72e3873
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,6 +29,7 @@
.pub-cache/
.pub/
build/
pubspec.lock

# Android related
**/android/**/gradle-wrapper.jar
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## [0.3.1]

- feat: update supabase to [v0.3.4](https://github.com/supabase-community/supabase-dart/blob/main/CHANGELOG.md#030)

## [0.3.0]

- BREAKING: update supabase to [v0.3.0](https://github.com/supabase-community/supabase-dart/blob/main/CHANGELOG.md#030)
Expand Down
10 changes: 7 additions & 3 deletions lib/src/local_storage.dart
Expand Up @@ -52,7 +52,7 @@ class EmptyLocalStorage extends LocalStorage {

static Future<void> _initialize() async {}
static Future<bool> _hasAccessToken() => Future.value(false);
static Future<String?> _accessToken() => Future.value(null);
static Future<String?> _accessToken() => Future.value();
static Future<void> _removePersistedSession() async {}
static Future<void> _persistSession(_) async {}
}
Expand Down Expand Up @@ -91,12 +91,16 @@ class HiveLocalStorage extends LocalStorage {

static Future<bool> _hasAccessToken() {
return Future.value(
Hive.box(_hiveBoxName).containsKey(supabasePersistSessionKey));
Hive.box(_hiveBoxName).containsKey(
supabasePersistSessionKey,
),
);
}

static Future<String?> _accessToken() {
return Future.value(
Hive.box(_hiveBoxName).get(supabasePersistSessionKey) as String?);
Hive.box(_hiveBoxName).get(supabasePersistSessionKey) as String?,
);
}

static Future<void> _removePersistedSession() {
Expand Down
9 changes: 6 additions & 3 deletions lib/src/supabase_auth.dart
Expand Up @@ -158,13 +158,16 @@ extension GoTrueClientSignInProvider on GoTrueClient {
/// See also:
///
/// * <https://supabase.io/docs/guides/auth#third-party-logins>
Future<bool> signInWithProvider(Provider provider,
{AuthOptions? options}) async {
Future<bool> signInWithProvider(
Provider provider, {
AuthOptions? options,
}) async {
final res = await signIn(
provider: provider,
options: options,
);
final result = await launch(res.url!, webOnlyWindowName: '_self');
final url = Uri.parse(res.url!);
final result = await launchUrl(url, webOnlyWindowName: '_self');
return result;
}
}
4 changes: 2 additions & 2 deletions lib/src/supabase_auth_required_state.dart
Expand Up @@ -37,13 +37,13 @@ abstract class SupabaseAuthRequiredState<T extends ConsumerStatefulWidget>
@override
void startAuthObserver() {
Supabase.instance.log('***** SupabaseAuthRequiredState startAuthObserver');
WidgetsBinding.instance?.addObserver(this);
WidgetsBinding.instance.addObserver(this);
}

@override
void stopAuthObserver() {
Supabase.instance.log('***** SupabaseAuthRequiredState stopAuthObserver');
WidgetsBinding.instance?.removeObserver(this);
WidgetsBinding.instance.removeObserver(this);
}

@override
Expand Down
5 changes: 2 additions & 3 deletions pubspec.yaml
@@ -1,6 +1,6 @@
name: supabase_flutter
description: Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
version: 0.2.12
version: 0.3.1
homepage: "https://supabase.io"
repository: "https://github.com/supabase/supabase-flutter"

Expand All @@ -13,8 +13,7 @@ dependencies:
sdk: flutter
hive: ^2.0.6
hive_flutter: ^1.1.0
flutter_riverpod: ^1.0.3
supabase: ^0.3.0
supabase: ^0.3.4
uni_links: ^0.5.1
url_launcher: ^6.0.10

Expand Down

0 comments on commit 72e3873

Please sign in to comment.