I created the login page and it worked fine until I created the sign_up page. The problem is that when I Signup it says success, but when I check Auth, the account is still not created. I searched on sources and documents. Hope you can take a look at the code and help me? import 'package:appwrite/appwrite.dart'; import 'package:flutter/material.dart'; import 'package:uuid/uuid.dart';
// Tạo một đối tượng UUID var uuid = Uuid();
// Tạo một chuỗi UUID duy nhất String userId = uuid.v4();
class SignupPage extends StatefulWidget { final Client? client;
SignupPage({Key? key, this.client}) : super(key: key);
@override _SignupPageState createState() => _SignupPageState(); }
class _SignupPageState extends State<SignupPage> { final TextEditingController _emailController = TextEditingController(); final TextEditingController _passwordController = TextEditingController(); final TextEditingController _nameController = TextEditingController();
Future<void> _signup() async { try { final email = _emailController.text; final password = _passwordController.text; final name = _nameController.text;
print('Email: $email');
print('Password: $password');
print('Name: $name');
print('UserId: $userId');
final account = Account(widget.client ?? Client());
// Loại bỏ tham số phone từ đây
// await account.createPhoneSession(userId: userId, phone: phone);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Đăng ký thành công!'),
),
);
} on AppwriteException catch (e) {
print('Lỗi từ server: ${e.message}');
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Đăng ký không thành công!'),
),
);
}
}
Please use descriptive titles so people have an idea what your problem is.
Also, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
Hello! Can anyone assist me? I have problem signing-up Auth (flutter).
oki, thanks bro
Success but no new account created
This code is for creating a phone session and the API call is commented out
Can you assist me, I'm new, I'm very grateful to you
yes
i removed the phone field but still not working
What? What's your new code?
this
Recommended threads
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...