Late initialization error field has not been initialized (solved)| Flutter | Dart
Вставка
- Опубліковано 21 кві 2022
- Here we will see how to solve the issues in flutter dart
#late initialization error field has not been initialized
#LateInitializationError: Field has not been initialized
#unhandle exception: late initialization error
#Late initialization error Field has not been initialized flutter
#LateInitializationError: Field,
#LateInitializationError: Field '_userData@32329253' has not been initialized
Buy me a coffee
www.buymeacoffee.com/dbestech...
⏫⏫⏫⏫🔥🔥Bloc advanced code(e-commerce app)
• Flutter Production Rea...
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥Riverpod advanced code🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
• Upcoming Riverpod E-co...
☞☞☞🥰🥰🥰Single vendor food app
• Flutter E-commerce App... - Наука та технологія
you are more than a teacher! most of teachers hide their mistakes but you are not, and correct them by teaching us how to. I'm in 2nd part hope more videos from you.💙
Wow, thank you!. More to come and pls share the tutorial so that other people can learn and I would be more motivated to create more tutorials.
You really just saved my life and hours of trial and errors... thank you so much
Most welcome
Thank you so much for this tutorial. As a beginner, I was struggling with a LateInitializationError on an app that I was developing. This was very helpful
You're very welcome!
A year later and this video saved me a lot of time. Thank you my brother for sharing this with us
You are most welcome. Like and share pls
This error have been bugging me for a long time, thank you!
Glad I could help!
thankyou for the thorough explanation of this problem . It really help in undersanding concepts
You are welcome
Thanks for this, it took me more than 24 hours to solve this problem.
Most welcome
Very good my brother! Thank you!!✌
Thank you too!
THANK YOU, you saved me
Like and share
great teacher thanks
You are welcome!
Thanks. Great tip. Love from Pakistan :)
Most welcome
thank you idk how to appreciate it. hope we meet in jannah 😻😻
I hope so too!
thanks a lot , its helpfull
Most welcome!
I think the Flutter team should update their official samples ASAP.
good one
Thanks
How solved this problem
idolo esta hace 6 horas con este problema!!!!!
what do you mean?
I am not sure what language you speak?
@@dbestech Thanks for the help! I solve the problem
i am getting Null check operator used on a null value
follow this
late List currencies;
late String from;
late String to;
late double rate;
String result = "";
this is my code. It states "LateError (LateInitializationError: Field 'currencies' has not been initialized" this error.can anyone give me a solution ASAP.
what error are you facing?
I did as you told but the page keeps loading. Can you help?
Did you try this www.dbestech.com/tutorials/flutter-food-delivery-e-commerce-app-documentation#id_3 this solution here?
The instance member 'photos ' can't be accessed in an intializer
hard to say without seeing the code. maybe you can instantiate the photos inside initState() method
Happy Aid Sir ! I still have the problem , maybe i have some missing things in my code. please can you help me ?
You mean the e-commerce app?
Lazy would be a cleaner solution without the null checks
hello sir, in following your tutorial part 1 for the food app delivery, no error but when I run it, it says " LateInitializationError: Field 'token' has not been initialized" , how and where should I check it sir, please help me.
set token to empty string
done, thanks a lot sir 🙏
@dbestech i am really a beginner and i started flutter with your course i am struck at the same time where should i make the string to empty string
@@bibilim9489can you help me please
I deleted the word token and it worked is it correct or wrong
:)
what's this?
i try you way to solve problem but dont solve it .
the error :
Exception has occurred.
LateError (LateInitializationError: Field 'password' has not been initialized.)
my code:
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:onlinestoreapp/core/class/status_requset.dart';
import 'package:onlinestoreapp/core/functions/handling_data.dart';
import 'package:onlinestoreapp/data/datasource/remote/forgotPassword/reset_password_data.dart';
import 'package:onlinestoreapp/utils/routes/app_routes.dart';
abstract class RsestPasswordController extends GetxController {
resetPassword();
}
class RsestPasswordControllerimp extends RsestPasswordController {
late TextEditingController password;
late TextEditingController repassword;
GlobalKey resetPasswordKey = GlobalKey();
ResetPasswordData resetPasswordData = ResetPasswordData(Get.find());
StatusRequest? statusRequest;
String? email;
bool isShowPassword = true;
bool isShowPassword1 = true;
showPassword() {
isShowPassword = isShowPassword == true ? false : true;
update();
}
showPassword1() {
isShowPassword1 = isShowPassword1 == true ? false : true;
update();
}
@override
resetPassword() async {
if (password.text != repassword.text) {
return Get.defaultDialog(
title: 'Error', middleText: 'Password Not Match');
}
if (resetPasswordKey.currentState!.validate()) {
statusRequest = StatusRequest.loading;
update();
var response = await resetPasswordData.postData(email!, password.text);
statusRequest = handlingData(response);
if (StatusRequest.success == statusRequest) {
if (response['status'] == 'success') {
Get.offNamed(AppRoutes.successResetPassword);
} else {
Get.defaultDialog(title: 'Worning', middleText: 'Try Again');
statusRequest = StatusRequest.failure;
}
}
update();
}
@override
void onInit() {
email = Get.arguments['email'];
password = TextEditingController();
repassword = TextEditingController();
super.onInit();
}
@override
void dispose() {
password.dispose();
repassword.dispose();
super.dispose();
}
}
}
you should say which line causes this problem?
Good day @dbestech and hope you are doing well?. I found another solution to this but don't know if there is a side effect to it, I called getUserinfo() from the main.dart just as you did with getCartData(). Do you think this is proper or I should follow your solution? Thanks.
Just do a check first whether the user logged in or not. Then you can call it from main.dart I think
@@dbestech alright, will do. Thanks for the reply.