step 4 : setting google sign di platform web

This commit is contained in:
sindhu1993
2024-08-23 11:16:20 +07:00
parent 461fb00aed
commit b4dea334d1
4 changed files with 39 additions and 21 deletions

31
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "absensi_sas_flutter_web",
"request": "launch",
"type": "dart",
"args": ["--web-port","5000"]
},
{
"name": "absensi_sas_flutter",
"request": "launch",
"type": "dart"
},
{
"name": "absensi_sas_flutter (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "absensi_sas_flutter (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}

View File

@@ -5,9 +5,9 @@ class Constant {
// static double designWidth = 1440;
// base url graphql
// static String baseURLGraphQl = "http://devone.aplikasi.web.id:3300/query";
static String baseURLGraphQl = "http://devone.aplikasi.web.id:3300/query";
static String baseURLGraphQl = "http://localhost:8080/query";
// static String baseURLGraphQl = "http://localhost:8080/query";
static String bearerName = "absensi-sas";
static String accountGoogle = "absensi-google-account";

View File

@@ -1,8 +1,11 @@
import 'package:google_sign_in/google_sign_in.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
const String googleClientID = "856240587825-klh0dfjc44bovajg1rpq5vbvs4g7rh5j.apps.googleusercontent.com";
final googleSignInProvider = StateProvider<GoogleSignIn>((ref) {
return GoogleSignIn(
clientId: googleClientID,
scopes: [
'email',
'https://www.googleapis.com/auth/contacts.readonly',

View File

@@ -24,6 +24,8 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="absensi_sas_flutter">
<!-- google sign in browser -->
<meta name="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" content="856240587825-klh0dfjc44bovajg1rpq5vbvs4g7rh5j.apps.googleusercontent.com">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
@@ -32,28 +34,10 @@
<title>absensi_sas_flutter</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>