From 5f4477c5bf733c7bf6d29bd71bc6191e14eb247a Mon Sep 17 00:00:00 2001 From: kleponijo <158453666+kleponijo@users.noreply.github.com> Date: Thu, 5 Feb 2026 18:23:06 +0700 Subject: [PATCH 1/2] lahh --- android/app/google-services.json | 15 +++++- android/settings.gradle.kts | 3 ++ firebase.json | 1 + lib/firebase_options.dart | 93 ++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 firebase.json create mode 100644 lib/firebase_options.dart diff --git a/android/app/google-services.json b/android/app/google-services.json index 8bf95a7..8030eb5 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,6 +1,7 @@ { "project_info": { "project_number": "219079385989", + "firebase_url": "https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app", "project_id": "klimatologiot", "storage_bucket": "klimatologiot.firebasestorage.app" }, @@ -12,7 +13,12 @@ "package_name": "com.example.klimatologiot" } }, - "oauth_client": [], + "oauth_client": [ + { + "client_id": "219079385989-8hkp1kg2pprs5k269s4c08r6rpdj1gjd.apps.googleusercontent.com", + "client_type": 3 + } + ], "api_key": [ { "current_key": "AIzaSyAN_9rnFxG99yficqRzTKJ7751D0GC0iXA" @@ -20,7 +26,12 @@ ], "services": { "appinvite_service": { - "other_platform_oauth_client": [] + "other_platform_oauth_client": [ + { + "client_id": "219079385989-8hkp1kg2pprs5k269s4c08r6rpdj1gjd.apps.googleusercontent.com", + "client_type": 3 + } + ] } } } diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index ca7fe06..174f408 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -20,6 +20,9 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" id("com.android.application") version "8.11.1" apply false + // START: FlutterFire Configuration + id("com.google.gms.google-services") version("4.3.15") apply false + // END: FlutterFire Configuration id("org.jetbrains.kotlin.android") version "2.2.20" apply false } diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..516c027 --- /dev/null +++ b/firebase.json @@ -0,0 +1 @@ +{"flutter":{"platforms":{"android":{"default":{"projectId":"klimatologiot","appId":"1:219079385989:android:1304b7433feb658ba0daec","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"klimatologiot","configurations":{"android":"1:219079385989:android:1304b7433feb658ba0daec","ios":"1:219079385989:ios:abf04f36d63bd3aaa0daec","macos":"1:219079385989:ios:abf04f36d63bd3aaa0daec","web":"1:219079385989:web:5034585bf9dc1252a0daec","windows":"1:219079385989:web:3677e02c6b4f1ceca0daec"}}}}}} \ No newline at end of file diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..4d228cc --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,93 @@ +// 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) { + return web; + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + return macos; + case TargetPlatform.windows: + return windows; + 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 web = FirebaseOptions( + apiKey: 'AIzaSyAZrk_k4DQ_ijCa6gp67oRklFMKD2dLcbQ', + appId: '1:219079385989:web:5034585bf9dc1252a0daec', + messagingSenderId: '219079385989', + projectId: 'klimatologiot', + authDomain: 'klimatologiot.firebaseapp.com', + databaseURL: 'https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app', + storageBucket: 'klimatologiot.firebasestorage.app', + ); + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyAN_9rnFxG99yficqRzTKJ7751D0GC0iXA', + appId: '1:219079385989:android:1304b7433feb658ba0daec', + messagingSenderId: '219079385989', + projectId: 'klimatologiot', + databaseURL: 'https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app', + storageBucket: 'klimatologiot.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyD1sRUSWC2nxONgcZ-zLMYr-tCHNPdVNT4', + appId: '1:219079385989:ios:abf04f36d63bd3aaa0daec', + messagingSenderId: '219079385989', + projectId: 'klimatologiot', + databaseURL: 'https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app', + storageBucket: 'klimatologiot.firebasestorage.app', + iosClientId: '219079385989-rrbf7b34t5rdvigs2l327qiheg357ogl.apps.googleusercontent.com', + iosBundleId: 'com.example.klimatologiot', + ); + + static const FirebaseOptions macos = FirebaseOptions( + apiKey: 'AIzaSyD1sRUSWC2nxONgcZ-zLMYr-tCHNPdVNT4', + appId: '1:219079385989:ios:abf04f36d63bd3aaa0daec', + messagingSenderId: '219079385989', + projectId: 'klimatologiot', + databaseURL: 'https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app', + storageBucket: 'klimatologiot.firebasestorage.app', + iosClientId: '219079385989-rrbf7b34t5rdvigs2l327qiheg357ogl.apps.googleusercontent.com', + iosBundleId: 'com.example.klimatologiot', + ); + + static const FirebaseOptions windows = FirebaseOptions( + apiKey: 'AIzaSyAZrk_k4DQ_ijCa6gp67oRklFMKD2dLcbQ', + appId: '1:219079385989:web:3677e02c6b4f1ceca0daec', + messagingSenderId: '219079385989', + projectId: 'klimatologiot', + authDomain: 'klimatologiot.firebaseapp.com', + databaseURL: 'https://klimatologiot-default-rtdb.asia-southeast1.firebasedatabase.app', + storageBucket: 'klimatologiot.firebasestorage.app', + ); +} From f96ca1217dbb17401242b9abf2e238d038f771ce Mon Sep 17 00:00:00 2001 From: kleponijo <158453666+kleponijo@users.noreply.github.com> Date: Thu, 5 Feb 2026 18:47:11 +0700 Subject: [PATCH 2/2] masih erorr --- lib/app_view.dart | 15 ++++++++++++++- lib/screens/home/views/home_screen.dart | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 lib/screens/home/views/home_screen.dart diff --git a/lib/app_view.dart b/lib/app_view.dart index f8e524f..a607ec5 100644 --- a/lib/app_view.dart +++ b/lib/app_view.dart @@ -1,4 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:klimatologiot/blocs/authentication_bloc/authentication_bloc.dart'; +import 'package:klimatologiot/screens/home/views/home_screen.dart'; class MyAppView extends StatelessWidget { const MyAppView({super.key}); @@ -6,15 +9,25 @@ class MyAppView extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'Klimatologi IOT', + title: 'Klimatologi', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.light( background: Colors.grey.shade100, onBackground: Colors.black, primary: Colors.blue, + onPrimary: Colors.white ), ), + home: BlocBuilder( + builder: ((context, state){ + if(state.status == AuthenticationStatus.authenticated){ + return HomeScreen(); + } else { + return WelcomeScreen(); + } + }), + ) ); } } \ No newline at end of file diff --git a/lib/screens/home/views/home_screen.dart b/lib/screens/home/views/home_screen.dart new file mode 100644 index 0000000..afc2972 --- /dev/null +++ b/lib/screens/home/views/home_screen.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatelessWidget{ + const HomeScreen ({super.key}); + @override + Widget build(BuildContext context) { + return Scaffold( + + ); + } +} \ No newline at end of file