This commit is contained in:
hack_23030943_f11325
2026-05-22 18:37:29 -06:00
parent 64187ec2db
commit acccfbc98c
10 changed files with 58 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
plugins {
id("com.android.application")
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")
}

View File

@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "338042609701",
"project_id": "hackon-58b23",
"storage_bucket": "hackon-58b23.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:338042609701:android:0f0f92d7f895794f371fcc",
"android_client_info": {
"package_name": "com.example.aplicacion_hack"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBuT70SbADLeg92ll8keCySI8I4eYyqyLw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -1,3 +1,14 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// Añadimos la herramienta de Google Services para que Android la pueda usar
classpath("com.google.gms:google-services:4.4.1")
}
}
allprojects {
repositories {
google()
@@ -21,4 +32,4 @@ subprojects {
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
}

Binary file not shown.

View File

@@ -44,18 +44,18 @@ void main() async {
// binding entre Flutter y el sistema operativo.
WidgetsFlutterBinding.ensureInitialized();
// Inicializar Firebase — REQUIERE que hayas corrido:
// > flutterfire configure
// Ese comando genera lib/firebase_options.dart automáticamente.
//
// ATAJO: Si aún no tienes Firebase configurado, comenta las
// siguientes 3 líneas y la app correrá sin notificaciones.
// -------------------------------------------------------
// await Firebase.initializeApp(
// options: DefaultFirebaseOptions.currentPlatform,
// );
// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
// -------------------------------------------------------
try {
// CAMBIAMOS EL BLOQUE COMENTADO POR ESTO:
// Al no pasarle opciones, lee el google-services.json automáticamente en Android.
await Firebase.initializeApp();
// Vinculamos el handler de notificaciones en segundo plano
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
debugPrint('🔥 Firebase inicializado con éxito en modo nativo.');
} catch (e) {
debugPrint('❌ Error al inicializar Firebase: $e');
}
runApp(const ResiduosApp());
}

View File

@@ -69,7 +69,7 @@ class ApiService {
//
// ATAJO: Cambia solo esta constante para apuntar a staging/prod.
// ============================================================
static const String _baseUrl = 'http://10.0.2.2:8000';
static const String _baseUrl = 'http://192.168.192.116:8000';
// static const String _baseUrl = 'http://127.0.0.1:8000'; // iOS Simulator
// static const String _baseUrl = 'http://192.168.1.XX:8000'; // Dispositivo físico

View File

@@ -1,4 +1,4 @@
name: residuos_notif
name: hack_on_linces_app
description: "Sistema de Notificación Privada de Recolección de Residuos - MVP Hackathon"
publish_to: 'none'
version: 1.0.0+1
@@ -22,7 +22,7 @@ dependencies:
# REQUERIDO antes de cualquier otro plugin de Firebase.
# Configura con: flutterfire configure (requiere Firebase CLI)
# ------------------------------------------------------------
firebase_core: ^3.0.0
firebase_core: ^3.15.2
# ------------------------------------------------------------
# firebase_messaging: Recepción de notificaciones push (FCM).
@@ -39,6 +39,7 @@ dependencies:
shared_preferences: ^2.2.0
cupertino_icons: ^1.0.6
firebase_auth: ^5.7.0
dev_dependencies:
flutter_test:

View File

@@ -1,30 +0,0 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:aplicacion_hack/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}