diff --git a/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart b/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart index 07cd53e4d818..504ad899e187 100644 --- a/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart +++ b/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart @@ -218,6 +218,15 @@ void main() { expect(await preferences.getStringList(listKey), testList); }); + testWidgets('getStringList returns mutable list', (WidgetTester _) async { + final SharedPreferencesAsync preferences = await getPreferences(); + + await preferences.setStringList(listKey, testList); + final List? list = await preferences.getStringList(listKey); + list?.add('value'); + expect(list?.length, testList.length + 1); + }); + testWidgets('getAll', (WidgetTester _) async { final SharedPreferencesAsync preferences = await getPreferences(); await Future.wait(>[