Skip to content

Commit

Permalink
Merge pull request #255 from himanshugoyal77/google-signout
Browse files Browse the repository at this point in the history
changed com.example to com.ccextractor
  • Loading branch information
Akshatji800 authored Feb 15, 2025
2 parents f3de26d + 0cff6df commit 3e84106
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 37 deletions.
26 changes: 23 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


android {
compileSdkVersion 34
buildToolsVersion '29.0.0'
Expand All @@ -38,19 +45,32 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.beacon"
applicationId "com.ccextractor.beacon"
minSdkVersion 23
targetSdkVersion 30
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
// Signing with the debug keys for now,
// so `flutter run --release` works.
crunchPngs false
shrinkResources true
signingConfig = signingConfigs.debug
signingConfig = signingConfigs.release
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.beacon">
package="com.ccextractor.beacon">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.beacon">
package="com.ccextractor.beacon">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
21 changes: 0 additions & 21 deletions android/app/src/main/kotlin/com/example/beacon/MainActivity.kt

This file was deleted.

2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.beacon">
package="com.ccextractor.beacon">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion lib/core/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Utils {
)
],
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha: 0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down
70 changes: 70 additions & 0 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions android = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
androidClientId: '',
iosClientId: '',
iosBundleId: '',
);
}
6 changes: 6 additions & 0 deletions lib/presentation/auth/auth_cubit/auth_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,10 @@ class AuthCubit extends Cubit<AuthState> {
error: 'Something went wrong please try again later!'));
}
}

void googleSignOut() async {
print('signing out');
GoogleSignIn _googleSignIn = GoogleSignIn();
await _googleSignIn.signOut();
}
}
8 changes: 6 additions & 2 deletions lib/presentation/auth/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ class _AuthScreenState extends State<AuthScreen>
final authCubit = BlocProvider.of<AuthCubit>(context);
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await onPopHome();
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await onPopHome();
if (popped == true) {
await SystemNavigator.pop();
}
return;
},
child: BlocConsumer<AuthCubit, AuthState>(
listener: (context, state) {
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/group/widgets/beacon_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _BeaconCardState extends State<BeaconCard> {
'${widget.beacon.title} is now active! \nYou can join the hike',
style: TextStyle(color: Colors.black),
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha: 0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class LocationCubit extends Cubit<LocationState> {
))
],
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha: 0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down Expand Up @@ -526,8 +526,8 @@ class LocationCubit extends Cubit<LocationState> {
circleId: CircleId('rippleCircle$index'),
center: locationToLatLng(user.location!),
radius: radius < 0 ? 0 : radius,
fillColor: Colors.red.withOpacity((0.5).clamp(0.0, 1.0)),
strokeColor: Colors.red.withOpacity(0.5),
fillColor: Colors.red.withValues(alpha: (0.5).clamp(0.0, 1.0)),
strokeColor: Colors.red.withValues(alpha: 0.5),
strokeWidth: 2,
);
});
Expand Down Expand Up @@ -752,7 +752,7 @@ class LocationCubit extends Cubit<LocationState> {
radius: radius,
strokeColor: Colors.blue,
strokeWidth: 2,
fillColor: Colors.blue.withOpacity(0.1),
fillColor: Colors.blue.withValues(alpha: 0.1),
));
}
emit(LoadedLocationState(
Expand Down
11 changes: 9 additions & 2 deletions lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:auto_route/auto_route.dart';
import 'package:beacon/domain/entities/group/group_entity.dart';
import 'package:beacon/presentation/auth/auth_cubit/auth_cubit.dart';
import 'package:beacon/presentation/home/home_cubit/home_cubit.dart';
import 'package:beacon/presentation/home/home_cubit/home_state.dart';
import 'package:beacon/presentation/group/widgets/create_join_dialog.dart';
Expand Down Expand Up @@ -99,9 +100,12 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await _onPopHome(context);
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await _onPopHome(context);
if (popped == true) {
await SystemNavigator.pop();
}
Expand Down Expand Up @@ -172,6 +176,9 @@ class _HomeScreenState extends State<HomeScreen> {
onTap: () async {
appRouter.replaceNamed('/auth');
localApi.deleteUser();
context
.read<AuthCubit>()
.googleSignOut();
},
text: 'Yes',
textSize: 18.0,
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Foundation

import connectivity_plus
import device_info_plus
import firebase_core
import flutter_local_notifications
import geolocator_apple
import google_sign_in_ios
Expand All @@ -18,6 +19,7 @@ import shared_preferences_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
Expand Down
3 changes: 3 additions & 0 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
#include "generated_plugin_registrant.h"

#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
Expand Down
1 change: 1 addition & 0 deletions windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
firebase_core
geolocator_windows
share_plus
url_launcher_windows
Expand Down

0 comments on commit 3e84106

Please sign in to comment.