managing-shared-preferences

managing-shared-preferences is a skill for Claude Code, Codex from Poorgramer-Zack/dart-expert-skills. It costs 143 tokens per session (984 once invoked), scanned A, original, MIT.

A guide to using SharedPreferences in Flutter, a small key-and-value store for keeping non-sensitive settings between app launches.

In plain words
What is it for?
Use it to save and read user preferences, app settings, feature-flag assignments, and simple cached values.
Why use it?
It avoids building a database for simple choices such as a theme, language, font size, or onboarding status.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to save and read user preferences, app settings, feature-flag assignments, and simple cached values.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Poorgramer-Zack/dart-expert-skills --skill flutter-shared-preferences
Clone the repo
git clone --depth 1 https://github.com/Poorgramer-Zack/dart-expert-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for managing-shared-preferences

README.md
[![agentmods](https://agentmods.dev/badge/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences/github.svg)](https://agentmods.dev/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences)
Your own site
<a href="https://agentmods.dev/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences"><img src="https://agentmods.dev/badge/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for managing-shared-preferences

Your own site · 80×15
<a href="https://agentmods.dev/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences"><img src="https://agentmods.dev/badge/skills/poorgramer-zack/dart-expert-skills/flutter-shared-preferences.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 984 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00143 $0.00984
Opus 5 $0.00072 $0.00492
Sonnet 5 $0.00029 $0.00197
Haiku 4.5 $0.00014 $0.00098

Measured 11d ago against content hash 25f153a5a4cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

managing-shared-preferences scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/flutter-shared-preferences/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SharedPreferences Simple Storage Guide

Goal

Implement lightweight key-value storage for non-sensitive app settings and user preferences using SharedPreferences. Best for simple configuration data that persists across app sessions.

Process

Phase 1: Install Dependencies

dependencies:
  shared_preferences: ^2.5.5

Phase 2: Create Static Wrapper (Best Practice)

Create a type-safe static wrapper to prevent key fragmentation:

import 'package:shared_preferences/shared_preferences.dart';

class Prefs {
  static late SharedPreferences _instance;
  
  static Future<void> init() async {
    _instance = await SharedPreferences.getInstance();
  }
  
  // Theme preference
  static bool get isDarkMode => _instance.getBool(_Keys.isDarkMode) ?? false;
  static Future<void> setDarkMode(bool value) => _instance.setBool(_Keys.isDarkMode, value);
  
  // User name
  static String? get userName => _instance.getString(_Keys.userName);
  static Future<void> setUserName(String value) => _instance.setString(_Keys.userName, value);
  
  // Onboarding completed
  static bool get hasCompletedOnboarding => _instance.getBool(_Keys.onboardingCompleted) ?? false;
  static Future<void> setOnboardingCompleted(bool value) => _instance.setBool(_Keys.onboardingCompleted, value);
  
  // Feature flags
  static bool get isFeatureXEnabled => _instance.getBool(_Keys.featureX) ?? false;
  static Future<void> setFeatureX(bool value) => _instance.setBool(_Keys.featureX, value);
  
  // Clear all preferences
  static Future<void> clear() => _instance.clear();
}

class _Keys {
  static const String isDarkMode = 'is_dark_mode';
  static const String userName = 'user_name';
  static const String onboardingCompleted = 'onboarding_completed';
  static const String featureX = 'feature_x_enabled';
}

Phase 3: Initialize in main()

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Prefs.init();
  runApp(MyApp());
}

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 129 lines · 143 tokens per session scan A 25f153a5a4cf

Subscribe to this mod's changes

managing-shared-preferences is a skill published in the GitHub repository Poorgramer-Zack/dart-expert-skills (7 stars, last pushed 1mo ago), licensed MIT. It adds 143 tokens to every session and 984 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.