File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/shared_preferences/shared_preferences/example/integration_test Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,15 @@ void main() {
218218 expect (await preferences.getStringList (listKey), testList);
219219 });
220220
221+ testWidgets ('getStringList returns mutable list' , (WidgetTester _) async {
222+ final SharedPreferencesAsync preferences = await getPreferences ();
223+
224+ await preferences.setStringList (listKey, testList);
225+ final List <String >? list = await preferences.getStringList (listKey);
226+ list? .add ('value' );
227+ expect (list? .length, testList.length + 1 );
228+ });
229+
221230 testWidgets ('getAll' , (WidgetTester _) async {
222231 final SharedPreferencesAsync preferences = await getPreferences ();
223232 await Future .wait (< Future <void >> [
You can’t perform that action at this time.
0 commit comments