skip to Main Content

Flutter – Riverpod 2.5 and Firebase

I'm currently working with Riverpod 2.5 and Google Sign-In, and I'm trying to figure out how to integrate Riverpod with it. Riverpod 2.5 recommends not using StateProvider and ChangeNotifier. Interestingly, all the examples in their documentation still use the old…

VIEW QUESTION

Flutter – Why does using ref.watch in Riverpod cause my Notifier to be disposed and recreated, but ref.read does not?

I’m working with Flutter Riverpod and have encountered different behaviors when using ref.watch versus ref.read in my DumTabNotifier class. Here’s a simplified version of my code: import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:get/get.dart'; // Notifier class class DumTabNotifier extends Notifier<DumTabState> {…

VIEW QUESTION

Flutter – Ref.read riverpod provider in a button onPressed getting disposed as soon it is initiated

When trying to read a collection from cloud_firestore, I'm using riverpod provider. import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../dataStructs.dart'; part 'ChargesProvider.g.dart'; @riverpod class GetCharges extends _$GetCharges { @override Future<Charges> build({required Layers layer}) async { final layerNumber = layer.toDBName(); final layerDoc =…

VIEW QUESTION
Back To Top
Search