mirror of
https://github.com/Dvorinka/1356.git
synced 2026-06-04 20:12:56 +00:00
build
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// id("com.google.gms.google-services")
|
||||
id("com.google.gms.google-services")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
@@ -54,8 +54,9 @@ flutter {
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
|
||||
implementation("com.google.android.gms:play-services-auth:20.7.0")
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
exclude(group = "com.aboutyou.dart_packages", module = "sign_in_with_apple")
|
||||
}
|
||||
// configurations.all {
|
||||
// exclude(group = "com.aboutyou.dart_packages", module = "sign_in_with_apple")
|
||||
// }
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"project_info": {"project_number": "123456789012", "project_id": "lifetimer-1356", "storage_bucket": "lifetimer-1356.appspot.com"}, "client": [{"client_info": {"mobilesdk_app_id": "1:123456789012:android:abcdef1234567890", "android_client_info": {"package_name": "com.example.lifetimer"}}, "oauth_client": [{"client_id": "123456789012-abcdef1234567890.apps.googleusercontent.com", "client_type": 3}], "api_key": [{"current_key": "AIzaSyabcdef1234567890abcdef1234567890"}], "services": {"appinvite_service": {"other_platform_oauth_client": [{"client_id": "123456789012-abcdef1234567890.apps.googleusercontent.com", "client_type": 3}]}}}], "configuration_version": "1"}
|
||||
@@ -26,6 +26,12 @@
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="lifetimer" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.google.gms:google-services:4.4.0")
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
|
||||
@@ -47,6 +47,14 @@
|
||||
<true/>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>lifetimer</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
|
||||
@@ -37,7 +37,10 @@ class AppScaffold extends StatelessWidget {
|
||||
actions: actions,
|
||||
)
|
||||
: null,
|
||||
body: SafeArea(child: body),
|
||||
body: body,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
floatingActionButton: floatingActionButton,
|
||||
bottomNavigationBar: bottomNavigationBar,
|
||||
);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import '../models/user_model.dart';
|
||||
import '../../bootstrap/supabase_client.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart' as supabase;
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
|
||||
|
||||
class AuthRepository {
|
||||
final supabase.SupabaseClient _client;
|
||||
@@ -110,30 +108,6 @@ class AuthRepository {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> signInWithApple() async {
|
||||
final credential = await SignInWithApple.getAppleIDCredential(
|
||||
scopes: [
|
||||
AppleIDAuthorizationScopes.email,
|
||||
AppleIDAuthorizationScopes.fullName,
|
||||
],
|
||||
);
|
||||
|
||||
final identityToken = credential.identityToken;
|
||||
if (identityToken == null) {
|
||||
throw Exception('No identity token from Apple sign-in');
|
||||
}
|
||||
|
||||
final response = await _client.auth.signInWithIdToken(
|
||||
provider: supabase.OAuthProvider.apple,
|
||||
idToken: identityToken,
|
||||
accessToken: credential.authorizationCode,
|
||||
);
|
||||
|
||||
if (response.user != null) {
|
||||
await _ensureUserProfileExists(response.user!.id, response.user!);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> signInWithGithub() async {
|
||||
await _client.auth.signInWithOAuth(
|
||||
supabase.OAuthProvider.github,
|
||||
|
||||
@@ -56,11 +56,6 @@ class AuthController extends StateNotifier<User?> {
|
||||
_analytics.logSignIn(method: 'google');
|
||||
}
|
||||
|
||||
Future<void> signInWithApple() async {
|
||||
await _authRepository.signInWithApple();
|
||||
_analytics.logSignIn(method: 'apple');
|
||||
}
|
||||
|
||||
Future<void> signInWithGithub() async {
|
||||
await _authRepository.signInWithGithub();
|
||||
_analytics.logSignIn(method: 'github');
|
||||
|
||||
@@ -35,23 +35,6 @@ class _AuthChoiceScreenState extends ConsumerState<AuthChoiceScreen> {
|
||||
}
|
||||
|
||||
|
||||
Future<void> _handleAppleSignIn() async {
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
await ref.read(authControllerProvider.notifier).signInWithApple();
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Apple sign-in failed: $e')),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _handleGithubSignIn() async {
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
@@ -164,13 +147,6 @@ class _AuthChoiceScreenState extends ConsumerState<AuthChoiceScreen> {
|
||||
onPressed: _handleGoogleSignIn,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_SocialButton(
|
||||
icon: Icons.apple,
|
||||
label: 'Continue with Apple',
|
||||
isLoading: _isLoading,
|
||||
onPressed: _handleAppleSignIn,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_SocialButton(
|
||||
icon: Icons.code,
|
||||
label: 'Continue with GitHub',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'bootstrap/bootstrap.dart';
|
||||
import 'core/theme/app_theme.dart';
|
||||
@@ -8,6 +9,17 @@ import 'core/state/providers.dart';
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
),
|
||||
);
|
||||
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.edgeToEdge,
|
||||
);
|
||||
|
||||
await bootstrap();
|
||||
|
||||
runApp(
|
||||
|
||||
@@ -1319,30 +1319,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
sign_in_with_apple:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sign_in_with_apple
|
||||
sha256: e84a62e17b7e463abf0a64ce826c2cd1f0b72dff07b7b275e32d5302d76fb4c5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.4"
|
||||
sign_in_with_apple_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sign_in_with_apple_platform_interface
|
||||
sha256: c2ef2ce6273fce0c61acd7e9ff5be7181e33d7aa2b66508b39418b786cca2119
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
sign_in_with_apple_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sign_in_with_apple_web
|
||||
sha256: "2f7c38368f49e3f2043bca4b46a4a61aaae568c140a79aa0675dc59ad0ca49bc"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
||||
@@ -20,7 +20,6 @@ dependencies:
|
||||
|
||||
# OAuth Authentication
|
||||
google_sign_in: ^6.2.1
|
||||
sign_in_with_apple: ^6.0.0
|
||||
|
||||
# Navigation
|
||||
go_router: ^12.1.3
|
||||
|
||||
Reference in New Issue
Block a user