Issue I have the following views: SettingsView (Stateless) – updates SharedPreferences on ToggleButton. HomeView (Stateful) – Displays an TestWidget if the SharedPreference has the value true (say PREF_DEBUG) The SettingsView is called using Navigator from a menu. I need HomeView
Continue readingTag: flutter-provider
The values for lat,lng returned by the provider are received as null in another page
Issue I am obtaining latitude and longitude using the location. The code below is what I have set up. The reason I used a Provider here is that the latitude and longitude values change whenever the location changes. import ‘package:flutter/material.dart’;
Continue readingRiverpod state is null after returning in the build of the notifier
Issue I have this notifier: class AsyncPlayerNotifier extends AsyncNotifier<PlayerData> { @override Future<PlayerData> build() async { return const PlayerData( PlayerRequestState: AsyncAction.initial(), player: null); } Future<void> setPlayer(Player player) async { state = const AsyncValue.loading(); // verify player // … state = AsyncValue<PlayernData>.data(state.value!.copyWith(
Continue readingCan't Call Widget From Another Widget but Can From Main
Issue I’m trying to make a simple app, where I have a slider that controls a timer set value. The user then hits a start button to start the timer and stop button to stop the timer. I’ve created a
Continue readingCan't Call Widget From Another Widget but Can From Main
Issue I’m trying to make a simple app, where I have a slider that controls a timer set value. The user then hits a start button to start the timer and stop button to stop the timer. I’ve created a
Continue readingError: Could not find the correct Provider<ThemeProvider> above this MyApp Widget
Issue I’ve got a problem, my code doesn’t work. I’ve looked through some of the already existing posts, but nothing has worked. my main.dart looks like this import ‘package:flutter/material.dart’; import ‘package:provider/provider.dart’; import ‘package:study_sync/auth/login_or_register.dart’; import ‘package:study_sync/theme/theme_provider.dart’; void main() { runApp(const MyApp());
Continue readingThe entered value of TextFormFied disappears when navigating to another page and coming back
Issue I want the TextFormFied value to persist even when navigating to another page and coming back. I think it can be achieved by using Provider. but don’t know how to update the controller with the proivder class instance variable.
Continue readingDetect which provider forces to update FutureProvider
Issue I have a state provider and a future provider that obtains data from this particular state provider. Let’s call this selectedEntityStateProvider and call future provider as weatherDataFutureProvider. I have a PageView which user can scroll and when page changed,
Continue readingWhat is best practise with flutter provider to lazy load data
Issue So when using provider with flutter, the main problem is that if want to specify the provider where its descendants need its value and its good until you don’t use navigation if we use navigation then we have to
Continue readingProvider notify other listeners from a ChangeNotifier
Issue I have the following setup: App with multiple pages: VoltagesPage & TemperaturesPage I will receive some data over bluetooth serial like so: bluetooth_data_provider.dart import ‘dart:convert’; import ‘dart:typed_data’; import ‘package:flutter/widgets.dart’; import ‘package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart’; class BluetoothDataProvider with ChangeNotifier { String _data =
Continue reading