125 questions
0
votes
0
answers
41
views
SharedPreferences not saving data in Flutter [duplicate]
I'm programing w/ Flutter and I have a error during the compilation. I can't run my app on android.
VS Code say this:
"The supplied phased action failed with an exception.\r\nCould not create ...
1
vote
0
answers
59
views
I’m getting the following error when trying to use the `shared_preferences` package in a Flutter desktop app (with multiple windows /secondary engine)
It looks like the plugin cannot establish a connection to the method channel.
From what I understand, shared_preferences relies on a platform channel that may not be registered when using multiple ...
0
votes
0
answers
32
views
Why does my flutter script for clearing preferences cause seemingly unrelated errors?
I'm working on an app that utilizes some preferences for login. For this, I'm using the shared_preferences package. The preferences work fine, but when I made a script to clear them for testing ...
0
votes
1
answer
141
views
Persiste theme mode with Riverpod
I'm trying to persiste ThemeMode using Riverpod and shared_preferences packages
Here is what I did in themeNotifier:
import 'package:flutter/material.dart';
import 'settings_repository.dart';
import '...
0
votes
1
answer
192
views
How can I clear/dispose Shared Preferences when logging out of a Flutter app?
Sorry my bad English in advance.
I would like to find out how I can clear SharedPreferences when I log out of the application. In my case, the Logout button is on screen 1 (HomePage).
On screen 2, I'm ...
0
votes
1
answer
543
views
Cant Manage to use correctly SharedPreferences on my Main.dart on Flutter?
I've been learning Flutter and learned this to improve usage with Pub.dev package Shared Preferences,
To sum up, it is to create a service that I can consume and work in a better way all around my app ...
0
votes
1
answer
243
views
Flutter SharedPreferences Error on iOS and macOS
I am trying to run my Flutter application via Xcode and I keep getting the error
Warning: Unable to create restoration in progress marker file (11db)
It seems to happen on line 18 of the file '...
0
votes
1
answer
68
views
Non-nullable instance of SharedPreferences must be initialized in Flutter
I want to store and read details using local storage. I have added dependencies in the pubspec.yaml file and imported the shared_preferences class.
Hint showed to add late before SharedPreferences ...
0
votes
2
answers
329
views
The default theme is displayed for a moment when the app is launched. [Flutter]
Themes are switched using RIverpod; ThemeMode is saved using Shared Preferences. They are working fine.But when I set the default values as follows, the default theme is shown for a moment at the ...
0
votes
1
answer
129
views
Is it possible to allow multiple entities to use one global ChangeNotifier in flutter?
I'm designing an application that allows users to view content of their desired integrations (this could be anything such as twitter, bbc.co.uk etc...). I have a settings page in which I would like ...
0
votes
2
answers
444
views
shared_preferences throws exception when trying to save a string on ios
I can not save a string using shared_preferences plugin for iOS.
Future<Map<String, dynamic>> login(String username, String password) async {
Map<String, dynamic> data = await ...
1
vote
1
answer
308
views
Why is the `await` keyword often omitted when using the shared_preferences plugin?
While using shared prefs plugin it's common to explore code like below
void saveList() async {
final prefs = await SharedPreferences.getInstance();
prefs.setStringList("listKey", aList); ...
0
votes
1
answer
2k
views
How to share persistent storage between isolates in flutter?
I am using android_alarm_manager_plus to run a dart isolate. In that isolate, I modify some data and I want those changes to reflect in the main isolate. Likewise, I want changes made in the main ...
1
vote
0
answers
46
views
How do I replace/ add to current data stored in Shared Preferences dynamically flutter
Screen
code
I am building a timesheet function on flutter where I get a list from JSON like this
[
{
"date": "2023-02-06 00:00:00.000",
"startTime": "2023-...
1
vote
2
answers
1k
views
Getx Storage return null whenever app starts
I have initilized GetStorage() in main() and calling .read() in onReady dunction of GetX Controller but always get null!
Future<void> main() async {
await GetStorage.init();
runApp(const App(...
1
vote
1
answer
41
views
Flutter: when move to new page shared_prefernce from some reason stop working
When back to BlueSettings page, initState show null on "Current value:"
When use stand alone BlueSettings whithout any MaterialPageRoute, it works
I want to use with MaterialPageRoute, what ...
1
vote
1
answer
540
views
Saving list of objects locally on device with shared_preferences in Flutter
I created an app that can send IR signals in which you can add IR signals yourself. The signals are saved in an object list named Item with items as the objects. I want the names and signals saved ...
0
votes
1
answer
26
views
Not able to see sharedpref folder in phone as well Getting this error :Exception has occurred. _CastError (Null check operator used on a null value)
Hello Guys I am new to flutter and working on a flutter project. Below is the code of my splash screen. What I am doing is when the app launched we get the data from sharedpreference if we got the ...
0
votes
2
answers
619
views
Save Bool Switch value with shared preferences - not working
I already followed a few examples on YT and also an example on pub.dev and I still have a problem with saving the Switch value from false to true. Regarding documentation, it looks like everything is ...
0
votes
1
answer
18
views
I`m trying to create data persistence using sharedpreferences, but i don`t exactly understand how SharedPreferences and Json work
I have a list of favourites:
List<MetroStation> favouriteData = <MetroStation>[];
And I also have a class of MetroStations with factory constructor to convert it to json and vice versa.
...
0
votes
2
answers
2k
views
Flutter Onboarding Screen Only Once With Splash Screen
I was working in Flutter to make an app and I only want the onboarding screen to be seen once by users. I have watched several videos showing how to do this, but the problem is my home screen will ...
3
votes
1
answer
1k
views
Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>' in type cast
Objective is to convert a String to List using map and return the value to a function call.
I am using SharedPreferences to save a list of object called where in I save the data at a point and get ...
1
vote
3
answers
298
views
prefs.getString telling me that a String is a String?
I am trying to save a string to shared preferences and then retrieve it.
However, my Android Studio tells me that there is an error.
Specifically, it says:
The argument type 'String?' can't be ...
0
votes
2
answers
268
views
How to show updated list in shared preferences on UI - Flutter
I am making an app in a flutter in which I can select the contacts from phone book and saving them in shared preferences. No problem in data saving and retrieving but i m struggling with showing the ...
0
votes
2
answers
775
views
Flutter - Load variables with SharedPreferences
I am learning how to use the SharedPreferences library in Flutter.
I created this code and I would like the counter and counter2 variables once I close and reopen the app to remain as the last save.
...