File tree Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:celest/celest.dart' ;
2
+
3
+ const auth = Auth (
4
+ providers: [
5
+ AuthProvider .google (),
6
+ ],
7
+ );
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ library celest;
3
3
4
4
export 'package:celest_core/celest_core.dart' ;
5
5
6
+ /// Auth
7
+ export 'src/auth/auth.dart' ;
8
+ export 'src/auth/auth_provider.dart' ;
9
+
6
10
/// Config
7
11
export 'src/config/env.dart' ;
8
12
Original file line number Diff line number Diff line change
1
+ import 'package:celest/src/auth/auth_provider.dart' ;
2
+
3
+ /// {@template celest.auth.auth}
4
+ /// The authentication component of your Celest project.
5
+ ///
6
+ /// The Auth widget defines the authentication providers which can be used to
7
+ /// sign in to your Celest project.
8
+ /// {@endtemplate}
9
+ final class Auth {
10
+ /// {@macro celest.auth.auth}
11
+ const Auth ({
12
+ required this .providers,
13
+ });
14
+
15
+ /// The authentication providers which can be used by your users when signing
16
+ /// in.
17
+ final List <AuthProvider > providers;
18
+ }
Original file line number Diff line number Diff line change
1
+ /// {@template celest.auth.auth_provider}
2
+ /// An authentication provider which can be used to sign in to Celest.
3
+ ///
4
+ /// Currently, Celest supports the following authentication methods:
5
+ /// - [AuthProvider.google] Sign in with Google
6
+ /// {@endtemplate}
7
+ sealed class AuthProvider {
8
+ const AuthProvider ();
9
+
10
+ /// A provider which enables Sign in with Google.
11
+ const factory AuthProvider .google () = _GoogleAuthProvider ;
12
+ }
13
+
14
+ final class _GoogleAuthProvider extends AuthProvider {
15
+ const _GoogleAuthProvider ();
16
+ }
Original file line number Diff line number Diff line change @@ -11,8 +11,14 @@ class Project implements CloudWidget {
11
11
/// {@macro celest.core.project}
12
12
const Project ({
13
13
required this .name,
14
+ this .logoUrl,
14
15
});
15
16
16
17
/// The name of the project as its identified in your Celest backend.
17
18
final String name;
19
+
20
+ /// The hosted URL of your project's logo.
21
+ ///
22
+ /// This is used by widgets like [Auth] to craft a custom login page.
23
+ final String ? logoUrl;
18
24
}
You can’t perform that action at this time.
0 commit comments