Connection problem to backend #8
-
Hello, I run backend on localhost. When I run app on I get authentication errors. Also, I get internet connection error in registration screen. Here is my .env file: Also, I tried these links in API_BASE_URL too. But It didn't work. When the app load I get errors on console log: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
RegisterBloc Change { currentState: RegisterState(blob:http://localhost:58426/de17258b-a909-4541-b972-dca2120bf982, Instance of 'RegisterFormState', true, Expected a value of type 'String', but got one of type 'Null'), nextState: RegisterState(blob:http://localhost:58426/de17258b-a909-4541-b972-dca2120bf982, Instance of 'RegisterFormState', true, Expected a value of type 'String', but got one of type 'Null') } |
Beta Was this translation helpful? Give feedback.
-
I have fixed the type casting error on the register page @override
Future<void> register(User user, String password) async {
FormData formData = FormData();
if (user.profileImageUrl != null) {
formData.files.add(MapEntry(
"profile_image",
await MultipartFile.fromFile(user.profileImageUrl!, filename: user.profileImageUrl!.split('/').last),
));
}
// i added this line
Map<String, dynamic> newUser = user.toJson().map((key, value) => MapEntry(key, value ?? 'null'));
formData.fields.addAll(newUser.cast<String, String>().entries);
formData.fields.add(MapEntry('password', password));
await _dio.post(
'/users',
data: formData,
);
} Check the latest commit |
Beta Was this translation helpful? Give feedback.
-
I've tried using |
Beta Was this translation helpful? Give feedback.
-
Hello,I run backend on Chrome. I run the auction app on Ios and Chrome.On local php and composer installed.I will try apache on local machine.Mustafa AksebzeciOn 11 Aug 2023, at 15:38, Ikhsan Satriadi ***@***.***> wrote:
I've tried using localhost:8080 (using php spark serve) but it doesn't work.
My suggestion is to use local hosting using a webserver like apache or XAMPP.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello again, I setup local and remote backend servers. But I couldn't get it run. Can you use this url and debug the problem? API_BASE_URL = 'https://mezatla-backend-aaebd516df80.herokuapp.com/' Also, I get this error in login screen: LoginBloc type 'String' is not a subtype of type 'int' of 'index' |
Beta Was this translation helpful? Give feedback.
I have fixed the type casting error on the register page