Upgrade Skill Di ITBOX Jadi Lebih Hemat
Special Diskon 50%
Sampai 16 November 2026!
Hari
Jam
Menit
Detik
GARUDABOX

Consumer Provider

  • This topic has 1 reply, 2 voices, and was last updated 4 years ago by Anonymous.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #170626
    Gmayoeda Winata
    Participant

      Selamat siang,
      terkait consumer di provider saya masih aga bingung untuk penempatan ChangeNotifierProvider dimana, kalo contoh kan disimpan di main.dart

      jika saya punya flow splashScreen -> Onboarding -> Login.

      untuk loginpage,
      ChangeNotifierProvider(create: (context) => LoginProviders()),

      saya taruh di main.dart error: Could not find the correct Provider<LoginProviders> above this LoginPage Widget.

      #170787
      Anonymous

        Halo, boleh dishare code nya?
        supaya provider ini bisa diakses di seluruh halaman/widget
        maka ChangeNotifierProvider harus diletakkan di main.dart sebagai parent dari wdiget MaterialApp.
        jadi ChangeNotifierProvider nya akan mempunyai child MaterialApp.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.
      Shopping cart0
      There are no products in the cart!
      Continue shopping