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...
  • Наука та технологія

КОМЕНТАРІ • 59

  • @hasi2694
    @hasi2694 2 роки тому +3

    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.💙

    • @dbestech
      @dbestech  2 роки тому +2

      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.

  • @egundeyioladotun8472
    @egundeyioladotun8472 2 роки тому

    You really just saved my life and hours of trial and errors... thank you so much

  • @techfauz
    @techfauz Рік тому

    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

  • @user-ec7rn5rm4q
    @user-ec7rn5rm4q 5 місяців тому

    A year later and this video saved me a lot of time. Thank you my brother for sharing this with us

    • @dbestech
      @dbestech  5 місяців тому

      You are most welcome. Like and share pls

  • @cantomris
    @cantomris 2 роки тому +1

    This error have been bugging me for a long time, thank you!

    • @dbestech
      @dbestech  2 роки тому

      Glad I could help!

  • @AbhinavSahu-vr3fp
    @AbhinavSahu-vr3fp Рік тому

    thankyou for the thorough explanation of this problem . It really help in undersanding concepts

  • @nasirismail5086
    @nasirismail5086 Рік тому

    Thanks for this, it took me more than 24 hours to solve this problem.

  • @matheusbezerra4166
    @matheusbezerra4166 3 місяці тому

    Very good my brother! Thank you!!✌

    • @dbestech
      @dbestech  3 місяці тому

      Thank you too!

  • @nisorun
    @nisorun 4 місяці тому

    THANK YOU, you saved me

    • @dbestech
      @dbestech  4 місяці тому

      Like and share

  • @fatima-cf1bj
    @fatima-cf1bj Рік тому

    great teacher thanks

  • @muzeasd
    @muzeasd Рік тому

    Thanks. Great tip. Love from Pakistan :)

  • @ymrizal4753
    @ymrizal4753 Рік тому

    thank you idk how to appreciate it. hope we meet in jannah 😻😻

  • @helmilaouiti5549
    @helmilaouiti5549 2 роки тому

    thanks a lot , its helpfull

  • @stonelam948
    @stonelam948 2 роки тому +1

    I think the Flutter team should update their official samples ASAP.

  • @dumisilendlovu3777
    @dumisilendlovu3777 2 роки тому

    good one

  • @mmm-tl6gq
    @mmm-tl6gq Рік тому

    How solved this problem

  • @dirojasvera
    @dirojasvera Рік тому

    idolo esta hace 6 horas con este problema!!!!!

    • @dbestech
      @dbestech  Рік тому

      what do you mean?

    • @dbestech
      @dbestech  Рік тому

      I am not sure what language you speak?

    • @dirojasvera
      @dirojasvera Рік тому

      @@dbestech Thanks for the help! I solve the problem

  • @Second_zoneHandler
    @Second_zoneHandler 6 місяців тому

    i am getting Null check operator used on a null value

  • @thisurividakna5950
    @thisurividakna5950 Рік тому

    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.

    • @dbestech
      @dbestech  Рік тому

      what error are you facing?

  • @padalaharshitagoud3621
    @padalaharshitagoud3621 2 роки тому

    I did as you told but the page keeps loading. Can you help?

    • @dbestech
      @dbestech  2 роки тому

      Did you try this www.dbestech.com/tutorials/flutter-food-delivery-e-commerce-app-documentation#id_3 this solution here?

  • @mmm-tl6gq
    @mmm-tl6gq Рік тому

    The instance member 'photos ' can't be accessed in an intializer

    • @dbestech
      @dbestech  Рік тому

      hard to say without seeing the code. maybe you can instantiate the photos inside initState() method

  • @khlifioussema1737
    @khlifioussema1737 2 роки тому

    Happy Aid Sir ! I still have the problem , maybe i have some missing things in my code. please can you help me ?

    • @dbestech
      @dbestech  2 роки тому

      You mean the e-commerce app?

  • @Marian-we7qj
    @Marian-we7qj 2 роки тому

    Lazy would be a cleaner solution without the null checks

  • @bibilim9489
    @bibilim9489 Рік тому

    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.

    • @dbestech
      @dbestech  Рік тому +1

      set token to empty string

    • @bibilim9489
      @bibilim9489 Рік тому

      done, thanks a lot sir 🙏

    • @sharksharu6460
      @sharksharu6460 7 місяців тому

      ​@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

    • @sharksharu6460
      @sharksharu6460 7 місяців тому

      ​@@bibilim9489can you help me please

    • @sharksharu6460
      @sharksharu6460 7 місяців тому

      I deleted the word token and it worked is it correct or wrong

  • @hassanjaffery7011
    @hassanjaffery7011 Рік тому

    :)

  • @abdelrhmanmusallam507
    @abdelrhmanmusallam507 Рік тому

    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();
    }
    }
    }

    • @dbestech
      @dbestech  Рік тому

      you should say which line causes this problem?

  • @jameshammond3482
    @jameshammond3482 2 роки тому

    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.

    • @dbestech
      @dbestech  2 роки тому

      Just do a check first whether the user logged in or not. Then you can call it from main.dart I think

    • @jameshammond3482
      @jameshammond3482 2 роки тому

      @@dbestech alright, will do. Thanks for the reply.