File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
+ import 'package:onesignal_flutter/onesignal_flutter.dart' ;
2
3
import 'package:supabase_flutter/supabase_flutter.dart' ;
3
4
4
5
class LoginForm extends StatefulWidget {
@@ -72,10 +73,15 @@ class _LoginFormState extends State<LoginForm> {
72
73
try {
73
74
final email = _emailController.text;
74
75
final password = _passwordController.text;
75
- await Supabase .instance.client.auth.signUp (
76
+ final authResponse =
77
+ await Supabase .instance.client.auth.signUp (
76
78
email: email,
77
79
password: password,
78
80
);
81
+ final id = authResponse.user? .id;
82
+ if (id != null ) {
83
+ OneSignal .shared.setExternalUserId (id);
84
+ }
79
85
} catch (e) {
80
86
ScaffoldMessenger .of (context).showSnackBar (SnackBar (
81
87
content: Text (e.toString () ?? "Signup failed" ),
You can’t perform that action at this time.
0 commit comments