From 71af3a0828a7f4dca8b7e948e905118864d6660e Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Sun, 4 Jan 2026 17:28:01 +0100 Subject: [PATCH] build --- .gitignore | 32 +++++++ build_apk.sh | 86 ++++++------------- lifetimer/android/app/build.gradle.kts | 9 +- lifetimer/android/app/google-services.json | 1 + .../android/app/src/main/AndroidManifest.xml | 6 ++ lifetimer/android/build.gradle.kts | 10 +++ lifetimer/ios/Runner/Info.plist | 8 ++ lifetimer/lib/core/widgets/app_scaffold.dart | 5 +- .../data/repositories/auth_repository.dart | 26 ------ .../auth/application/auth_controller.dart | 5 -- .../auth/presentation/auth_choice_screen.dart | 24 ------ .../presentation/profile_setup_screen.dart | 1 - lifetimer/lib/main.dart | 12 +++ lifetimer/pubspec.lock | 24 ------ lifetimer/pubspec.yaml | 1 - 15 files changed, 103 insertions(+), 147 deletions(-) create mode 100644 lifetimer/android/app/google-services.json diff --git a/.gitignore b/.gitignore index 1f6abd0..4575858 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,35 @@ coverage/ # OS generated files Thumbs.db + +# Documentation and project files +ANALYTICS_SETUP_GUIDE.md +APK_BUILD_GUIDE.md +APP_STORE_ASSETS_GUIDE.md +APP_STORE_METADATA.md +architecture.md +build_apk.sh +CODE_REVIEW_REPORT.md +database-schema.md +development-roadmap.md +flutter-project-structure.md +GIT_RELEASE_GUIDE.md +navigation-and-user-flows.md +project.md +requirements-functional.md +requirements-nonfunctional.md +SECURITY_AUDIT_REPORT.md +security-and-privacy.md +timeline.md +ui-ux-spec.md + +# Images +image.png +image copy.png +image copy 2.png +Screenshot 2026-01-03 172853.png +Screenshot 2026-01-03 172901.png +Screenshot 2026-01-03 172907.png + +# Supabase directory +supabase/ diff --git a/build_apk.sh b/build_apk.sh index 8a40bc1..57e5a9d 100755 --- a/build_apk.sh +++ b/build_apk.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Build APK Script for LifeTimer Flutter App -# This script provides multiple approaches to build the APK +# Build Script for LifeTimer Flutter App +# Creates versioned APK in build/release directory echo "LifeTimer APK Build Script" echo "==========================" @@ -12,77 +12,41 @@ cd lifetimer echo "Current directory: $(pwd)" echo "Flutter version: $(flutter --version | head -n 1)" -# Approach 1: Try building debug APK with minimal changes -echo "" -echo "Approach 1: Building debug APK..." -echo "================================" +# Get version from pubspec.yaml +VERSION=$(grep "version:" pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1) +BUILD_NUMBER=$(grep "version:" pubspec.yaml | cut -d'+' -f2) -# Temporarily disable problematic plugins -echo "Temporarily disabling problematic plugins..." +echo "Building LifeTimer version $VERSION (build $BUILD_NUMBER)" -# Create a temporary pubspec.yaml without problematic dependencies -cp pubspec.yaml pubspec.yaml.backup +# Create release directory +mkdir -p build/release -# Comment out problematic dependencies -sed -i 's/^ sign_in_with_apple:/ # sign_in_with_apple:/' pubspec.yaml -sed -i 's/^ supabase_flutter:/ # supabase_flutter:/' pubspec.yaml - -# Clean and get dependencies -flutter clean -flutter pub get - -# Try building APK -echo "Attempting to build APK..." -if flutter build apk --debug; then +# Build APK with version info and .env configuration +echo "Building APK with .env configuration..." +if flutter build apk --dart-define-from-file=.env --build-name=$VERSION --build-number=$BUILD_NUMBER; then echo "✅ APK build successful!" - echo "APK location: build/app/outputs/flutter-apk/app-debug.apk" + + # Copy to release directory with versioned name + cp build/app/outputs/flutter-apk/app-release.apk build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk + + echo "✅ Build complete: build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk" # Show APK info - ls -lh build/app/outputs/flutter-apk/app-debug.apk - - # Restore original pubspec.yaml - mv pubspec.yaml.backup pubspec.yaml - flutter pub get + ls -lh build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk echo "" - echo "Build completed successfully!" - echo "You can install the APK with: adb install build/app/outputs/flutter-apk/app-debug.apk" + echo "You can install the APK with: adb install build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk" else - echo "❌ APK build failed with Approach 1" - - # Restore original pubspec.yaml - mv pubspec.yaml.backup pubspec.yaml - flutter pub get - + echo "❌ APK build failed" echo "" - echo "Approach 2: Building with release mode..." - echo "=====================================" + echo "Troubleshooting steps:" + echo "1. Update Flutter: flutter upgrade" + echo "2. Clean project: flutter clean && flutter pub get" + echo "3. Check Android SDK installation" + echo "4. Verify .env file exists and is properly formatted" - # Try release build - if flutter build apk --release; then - echo "✅ Release APK build successful!" - echo "APK location: build/app/outputs/flutter-apk/app-release.apk" - - # Show APK info - ls -lh build/app/outputs/flutter-apk/app-release.apk - - echo "" - echo "Build completed successfully!" - echo "You can install the APK with: adb install build/app/outputs/flutter-apk/app-release.apk" - - else - echo "❌ Both approaches failed" - echo "" - echo "Manual troubleshooting steps:" - echo "1. Update Flutter to latest version: flutter upgrade" - echo "2. Clean project: flutter clean && flutter pub get" - echo "3. Check Android SDK installation" - echo "4. Try building with specific target: flutter build apk --target-platform android-arm64" - echo "5. Consider updating problematic dependencies in pubspec.yaml" - - exit 1 - fi + exit 1 fi echo "" diff --git a/lifetimer/android/app/build.gradle.kts b/lifetimer/android/app/build.gradle.kts index 79f8a74..9d562e8 100644 --- a/lifetimer/android/app/build.gradle.kts +++ b/lifetimer/android/app/build.gradle.kts @@ -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") +// } diff --git a/lifetimer/android/app/google-services.json b/lifetimer/android/app/google-services.json new file mode 100644 index 0000000..63cbef3 --- /dev/null +++ b/lifetimer/android/app/google-services.json @@ -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"} diff --git a/lifetimer/android/app/src/main/AndroidManifest.xml b/lifetimer/android/app/src/main/AndroidManifest.xml index 9f7355d..a1d0818 100644 --- a/lifetimer/android/app/src/main/AndroidManifest.xml +++ b/lifetimer/android/app/src/main/AndroidManifest.xml @@ -26,6 +26,12 @@ + + + + + + diff --git a/lifetimer/android/build.gradle.kts b/lifetimer/android/build.gradle.kts index aa0fb7b..55ee906 100644 --- a/lifetimer/android/build.gradle.kts +++ b/lifetimer/android/build.gradle.kts @@ -1,3 +1,13 @@ +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.google.gms:google-services:4.4.0") + } +} + allprojects { repositories { google() diff --git a/lifetimer/ios/Runner/Info.plist b/lifetimer/ios/Runner/Info.plist index 3e8ce09..14f4ee3 100644 --- a/lifetimer/ios/Runner/Info.plist +++ b/lifetimer/ios/Runner/Info.plist @@ -47,6 +47,14 @@ CFBundleURLTypes + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + lifetimer + + CFBundleTypeRole Editor diff --git a/lifetimer/lib/core/widgets/app_scaffold.dart b/lifetimer/lib/core/widgets/app_scaffold.dart index 0f06e9a..5af1f7b 100644 --- a/lifetimer/lib/core/widgets/app_scaffold.dart +++ b/lifetimer/lib/core/widgets/app_scaffold.dart @@ -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, ); diff --git a/lifetimer/lib/data/repositories/auth_repository.dart b/lifetimer/lib/data/repositories/auth_repository.dart index fcc41ca..cf9bba9 100644 --- a/lifetimer/lib/data/repositories/auth_repository.dart +++ b/lifetimer/lib/data/repositories/auth_repository.dart @@ -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 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 signInWithGithub() async { await _client.auth.signInWithOAuth( supabase.OAuthProvider.github, diff --git a/lifetimer/lib/features/auth/application/auth_controller.dart b/lifetimer/lib/features/auth/application/auth_controller.dart index d6929ac..a2fd6a1 100644 --- a/lifetimer/lib/features/auth/application/auth_controller.dart +++ b/lifetimer/lib/features/auth/application/auth_controller.dart @@ -56,11 +56,6 @@ class AuthController extends StateNotifier { _analytics.logSignIn(method: 'google'); } - Future signInWithApple() async { - await _authRepository.signInWithApple(); - _analytics.logSignIn(method: 'apple'); - } - Future signInWithGithub() async { await _authRepository.signInWithGithub(); _analytics.logSignIn(method: 'github'); diff --git a/lifetimer/lib/features/auth/presentation/auth_choice_screen.dart b/lifetimer/lib/features/auth/presentation/auth_choice_screen.dart index 5ab9956..244c105 100644 --- a/lifetimer/lib/features/auth/presentation/auth_choice_screen.dart +++ b/lifetimer/lib/features/auth/presentation/auth_choice_screen.dart @@ -35,23 +35,6 @@ class _AuthChoiceScreenState extends ConsumerState { } - Future _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 _handleGithubSignIn() async { setState(() => _isLoading = true); try { @@ -164,13 +147,6 @@ class _AuthChoiceScreenState extends ConsumerState { 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', diff --git a/lifetimer/lib/features/profile/presentation/profile_setup_screen.dart b/lifetimer/lib/features/profile/presentation/profile_setup_screen.dart index 7e2deb6..dfabf3d 100644 --- a/lifetimer/lib/features/profile/presentation/profile_setup_screen.dart +++ b/lifetimer/lib/features/profile/presentation/profile_setup_screen.dart @@ -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'; diff --git a/lifetimer/lib/main.dart b/lifetimer/lib/main.dart index bd387fd..4766160 100644 --- a/lifetimer/lib/main.dart +++ b/lifetimer/lib/main.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( diff --git a/lifetimer/pubspec.lock b/lifetimer/pubspec.lock index cd6e379..04f97f9 100644 --- a/lifetimer/pubspec.lock +++ b/lifetimer/pubspec.lock @@ -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 diff --git a/lifetimer/pubspec.yaml b/lifetimer/pubspec.yaml index 1dfc75e..cf63d0b 100644 --- a/lifetimer/pubspec.yaml +++ b/lifetimer/pubspec.yaml @@ -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