Skip to content

Commit 9fe5684

Browse files
committed
Merge branch 'main' of github.com:bulgariamitko/flutterflowtutorials
2 parents 0d63200 + 05ace88 commit 9fe5684

File tree

6 files changed

+100
-2
lines changed

6 files changed

+100
-2
lines changed

Source-Code/ff_source_code/lib/auth/base_auth_user_provider.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ abstract class BaseAuthUser {
2222

2323
Future? delete();
2424
Future? updateEmail(String email);
25+
Future? updatePassword(String newPassword);
2526
Future? sendEmailVerification();
2627
Future refreshUser() async {}
2728

Source-Code/ff_source_code/lib/auth/firebase_auth/firebase_auth_manager.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,27 @@ class FirebaseAuthManager extends AuthManager
103103
}
104104
}
105105

106+
@override
107+
Future updatePassword({
108+
required String newPassword,
109+
required BuildContext context,
110+
}) async {
111+
try {
112+
if (!loggedIn) {
113+
print('Error: update password attempted with no logged in user!');
114+
return;
115+
}
116+
await currentUser?.updatePassword(newPassword);
117+
} on FirebaseAuthException catch (e) {
118+
if (e.code == 'requires-recent-login') {
119+
ScaffoldMessenger.of(context).hideCurrentSnackBar();
120+
ScaffoldMessenger.of(context).showSnackBar(
121+
SnackBar(content: Text('Error: ${e.message!}')),
122+
);
123+
}
124+
}
125+
}
126+
106127
@override
107128
Future resetPassword({
108129
required String email,

Source-Code/ff_source_code/lib/auth/firebase_auth/firebase_user_provider.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class FfSourceCodeFirebaseUser extends BaseAuthUser {
3131
}
3232
}
3333

34+
@override
35+
Future? updatePassword(String newPassword) async {
36+
await user?.updatePassword(newPassword);
37+
}
38+
3439
@override
3540
Future? sendEmailVerification() => user?.sendEmailVerification();
3641

Source-Code/ff_source_code/lib/backend/supabase/database/table.dart

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,74 @@ abstract class SupabaseTable<T extends SupabaseDataRow> {
6262
}
6363
}
6464

65+
extension NullSafePostgrestFilters on PostgrestFilterBuilder {
66+
PostgrestFilterBuilder eqOrNull(String column, dynamic value) {
67+
return value != null ? eq(column, value) : this;
68+
}
69+
70+
PostgrestFilterBuilder neqOrNull(String column, dynamic value) {
71+
return value != null ? neq(column, value) : this;
72+
}
73+
74+
PostgrestFilterBuilder ltOrNull(String column, dynamic value) {
75+
return value != null ? lt(column, value) : this;
76+
}
77+
78+
PostgrestFilterBuilder lteOrNull(String column, dynamic value) {
79+
return value != null ? lte(column, value) : this;
80+
}
81+
82+
PostgrestFilterBuilder gtOrNull(String column, dynamic value) {
83+
return value != null ? gt(column, value) : this;
84+
}
85+
86+
PostgrestFilterBuilder gteOrNull(String column, dynamic value) {
87+
return value != null ? gte(column, value) : this;
88+
}
89+
90+
PostgrestFilterBuilder containsOrNull(String column, dynamic value) {
91+
return value != null ? contains(column, value) : this;
92+
}
93+
94+
PostgrestFilterBuilder overlapsOrNull(String column, dynamic value) {
95+
return value != null ? overlaps(column, value) : this;
96+
}
97+
98+
PostgrestFilterBuilder inFilterOrNull(String column, List<dynamic>? values) {
99+
return values != null ? inFilter(column, values) : this;
100+
}
101+
}
102+
103+
extension NullSafeSupabaseStreamFilters on SupabaseStreamFilterBuilder {
104+
SupabaseStreamBuilder eqOrNull(String column, dynamic value) {
105+
return value != null ? eq(column, value) : this;
106+
}
107+
108+
SupabaseStreamBuilder neqOrNull(String column, dynamic value) {
109+
return value != null ? neq(column, value) : this;
110+
}
111+
112+
SupabaseStreamBuilder ltOrNull(String column, dynamic value) {
113+
return value != null ? lt(column, value) : this;
114+
}
115+
116+
SupabaseStreamBuilder lteOrNull(String column, dynamic value) {
117+
return value != null ? lte(column, value) : this;
118+
}
119+
120+
SupabaseStreamBuilder gtOrNull(String column, dynamic value) {
121+
return value != null ? gt(column, value) : this;
122+
}
123+
124+
SupabaseStreamBuilder gteOrNull(String column, dynamic value) {
125+
return value != null ? gte(column, value) : this;
126+
}
127+
128+
SupabaseStreamBuilder inFilterOrNull(String column, List<Object>? values) {
129+
return values != null ? inFilter(column, values) : this;
130+
}
131+
}
132+
65133
class PostgresTime {
66134
PostgresTime(this.time);
67135
DateTime? time;

Source-Code/ff_source_code/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ dependencies:
9292
path_provider_foundation: 2.4.0
9393
path_provider_linux: 2.2.1
9494
path_provider_platform_interface: 2.1.2
95-
path_provider_windows: 2.2.1
95+
path_provider_windows: 2.3.0
9696
plugin_platform_interface: 2.1.8
9797
postgrest: 2.1.4
9898
provider: 6.1.2

Source-Code/ff_source_code/web/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
The path provided below has to start and end with a slash "/" in order for
99
it to work correctly.
1010
11+
Alternatively, build your application passing the --base-href parameter
12+
specifying the new root path of your web app.
13+
1114
Fore more details:
1215
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
1316
-->
14-
<base href="/">
17+
<base href="$FLUTTER_BASE_HREF">
1518

1619
<meta charset="UTF-8">
1720
<meta content="IE=Edge" http-equiv="X-UA-Compatible">

0 commit comments

Comments
 (0)