diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 97e9da7..498242b 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -2,6 +2,8 @@
+
+
Bool {
+ GMSServices.provideAPIKey("YOUR_iOS_API_KEY_HERE")
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
diff --git a/lib/core/widgets/impact_row.dart b/lib/core/widgets/impact_row.dart
index 637504b..287e79b 100644
--- a/lib/core/widgets/impact_row.dart
+++ b/lib/core/widgets/impact_row.dart
@@ -24,7 +24,7 @@ class ImpactRow extends StatelessWidget {
LinearProgressIndicator(
value: value,
color: color,
- backgroundColor: color.withOpacity(0.1),
+ backgroundColor: color.withValues(alpha: 0.1),
minHeight: 12,
borderRadius: BorderRadius.circular(10),
),
diff --git a/lib/core/widgets/smart_result_modal.dart b/lib/core/widgets/smart_result_modal.dart
index e1e323b..65b1d27 100644
--- a/lib/core/widgets/smart_result_modal.dart
+++ b/lib/core/widgets/smart_result_modal.dart
@@ -37,7 +37,7 @@ class SmartResultModal extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
decoration: BoxDecoration(
- color: themeColor.withOpacity(0.1),
+ color: themeColor.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: themeColor, width: 2),
),
diff --git a/lib/features/auth/data/auth_repository.dart b/lib/features/auth/data/auth_repository.dart
index 362f824..7f144b0 100644
--- a/lib/features/auth/data/auth_repository.dart
+++ b/lib/features/auth/data/auth_repository.dart
@@ -22,4 +22,19 @@ class AuthRepository {
Future logout() async {
await auth.signOut();
}
+ Future changePassword({required String currentPassword, required String newPassword}) async {
+ final user = FirebaseAuth.instance.currentUser;
+ if (user == null || user.email == null) throw "User not found";
+
+ // 1. Re-authenticate the user (Required by Firebase for security)
+ AuthCredential credential = EmailAuthProvider.credential(
+ email: user.email!,
+ password: currentPassword,
+ );
+
+ await user.reauthenticateWithCredential(credential);
+
+ // 2. Update to new password
+ await user.updatePassword(newPassword);
+}
}
diff --git a/lib/features/auth/ui/register_screen.dart b/lib/features/auth/ui/register_screen.dart
index 32251a6..7676c82 100644
--- a/lib/features/auth/ui/register_screen.dart
+++ b/lib/features/auth/ui/register_screen.dart
@@ -90,7 +90,7 @@ class _RegisterScreenState extends ConsumerState {
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
- BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 20, offset: const Offset(0, 10)),
+ BoxShadow(color: Colors.black.withValues(alpha: 0.1), blurRadius: 20, offset: const Offset(0, 10)),
],
),
child: Padding(
@@ -213,8 +213,8 @@ class _RegisterScreenState extends ConsumerState {
),
child: Stack(
children: [
- Positioned(top: -50, right: -50, child: _circleDeco(150, Colors.white.withOpacity(0.1))),
- Positioned(top: 50, left: -20, child: _circleDeco(100, Colors.white.withOpacity(0.05))),
+ Positioned(top: -50, right: -50, child: _circleDeco(150, Colors.white.withValues(alpha: 0.1))),
+ Positioned(top: 50, left: -20, child: _circleDeco(100, Colors.white.withValues(alpha: 0.05))),
const Positioned(
top: 80,
left: 30,
@@ -240,7 +240,7 @@ class _RegisterScreenState extends ConsumerState {
labelText: label,
prefixIcon: Icon(icon, color: Colors.green[700]),
filled: true,
- fillColor: Colors.green.withOpacity(0.05),
+ fillColor: Colors.green.withValues(alpha: 0.05),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(15), borderSide: BorderSide.none),
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15), borderSide: BorderSide.none),
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15), borderSide: const BorderSide(color: Colors.green, width: 2)),
diff --git a/lib/features/auth/ui/welcome_screen.dart b/lib/features/auth/ui/welcome_screen.dart
index 1af3495..79fdef1 100644
--- a/lib/features/auth/ui/welcome_screen.dart
+++ b/lib/features/auth/ui/welcome_screen.dart
@@ -65,7 +65,7 @@ class WelcomeScreen extends StatelessWidget {
color: Colors.white,
boxShadow: [
BoxShadow(
- color: Colors.green.withOpacity(0.05),
+ color: Colors.green.withValues(alpha: 0.05),
blurRadius: 20,
offset: const Offset(0, -5),
),
@@ -136,8 +136,8 @@ class WelcomeScreen extends StatelessWidget {
child: Stack(
clipBehavior: Clip.none,
children: [
- Positioned(top: -50, right: -20, child: _circleDeco(150, Colors.white.withOpacity(0.08))),
- Positioned(bottom: -30, left: -40, child: _circleDeco(120, Colors.white.withOpacity(0.05))),
+ Positioned(top: -50, right: -20, child: _circleDeco(150, Colors.white.withValues(alpha: 0.08))),
+ Positioned(bottom: -30, left: -40, child: _circleDeco(120, Colors.white.withValues(alpha: 0.05))),
Center(
child: Column(
@@ -149,7 +149,7 @@ class WelcomeScreen extends StatelessWidget {
color: Colors.white,
shape: BoxShape.circle,
boxShadow: [
- BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 20, offset: const Offset(0, 10)),
+ BoxShadow(color: Colors.black.withValues(alpha: 0.1), blurRadius: 20, offset: const Offset(0, 10)),
],
),
child: const Icon(Icons.eco_rounded, size: 50, color: Color(0xFF1B5E20)),
@@ -163,7 +163,7 @@ class WelcomeScreen extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
decoration: BoxDecoration(
- color: Colors.white.withOpacity(0.2),
+ color: Colors.white.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(20),
),
child: const Text(
@@ -186,14 +186,14 @@ class WelcomeScreen extends StatelessWidget {
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
- BoxShadow(color: Colors.black.withOpacity(0.03), blurRadius: 15, offset: const Offset(0, 8)),
+ BoxShadow(color: Colors.black.withValues(alpha: 0.03), blurRadius: 15, offset: const Offset(0, 8)),
],
),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(12),
- decoration: BoxDecoration(color: iconColor.withOpacity(0.1), shape: BoxShape.circle),
+ decoration: BoxDecoration(color: iconColor.withValues(alpha: 0.1), shape: BoxShape.circle),
child: Icon(icon, color: iconColor, size: 28),
),
const SizedBox(width: 16),
diff --git a/lib/features/home/controllers/analytics_controller.dart b/lib/features/home/controllers/analytics_controller.dart
index 83bb9a3..7e711ca 100644
--- a/lib/features/home/controllers/analytics_controller.dart
+++ b/lib/features/home/controllers/analytics_controller.dart
@@ -2,7 +2,6 @@ import 'dart:async';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
-import '../models/user_model.dart';
// Use a simple enum for the filters
enum AnalyticsFilter { week, month, allTime }
@@ -30,9 +29,8 @@ class AnalyticsController extends AsyncNotifier