Wraps Flutter shared_preferences plugin, providing a iOS Suite Name support, it's helpful for sharing data from App to Widget.

Overview

shared_preferences_ios_sn

Wraps Flutter shared_preferences plugin and provides an iOS Suite Name support, it's helpful for sharing data from App to iOS Widget.

Why Need "Suite Name" Feature?

When you need to share your data from your App to iOS Widget

Usage

in pubspec.yaml:

shared_preferences_ios_sn: ^1.0.2

#shared_preferences: x.x.x //should comment 'shared_preferences' 

and just run the follow command to install the plugin:

flutter pub get

in Flutter code:

//final prefs = SharedPreferences.getInstance();

//use this to instead of above, prefs will works like a normal SharedPreferences instance in many different platforms.
final prefs = await SPUtil.withSuitName("<Your iOS GROUP NAME>");
prefs.setString("test_key", "test_value");

in iOS Widget swift code:

//now you can get the SharedPreferences data from App in your widget code, for example:
//dont forget to add prefix "flutter." to the key:
print("test_key:",UserDefaults(suiteName: "<Your iOS GROUP NAME>")?.string(forKey: "flutter.test_key"))

You might also like...

Dart API Client which wraps the QvaPay API

qvapay_api_client Dart API Client which wraps the QvaPay API The client needs Dio to perform the requests, you must inject an instance in the construc

Nov 2, 2022

Dart package that conveniently wraps an isolate, ports and state for easy isolates.

Isolate Agents Description Isolate Agents adds a new class, Agent, which is a proper implementation of the Actor model for Dart. Where Isolates have n

Jan 2, 2023

This library allows you to create editable tables and spreadsheets with ease, either by providing initial row and column count to display an empty table or use it with predefined rows and column data sets.

This library allows you to create editable tables and spreadsheets with ease, either by providing initial row and column count to display an empty table or use it with predefined rows and column data sets.

Editable ⚡️ A highly customizable, editable table package for Flutter projects. Specs This package allows you to create editable tables and spreadshee

Dec 7, 2022

A flutter widget which renders its child outside the original widget hierarchy.

 A flutter widget which renders its child outside the original widget hierarchy.

overlay_container A flutter widget which renders its child outside the original widget hierarchy. Demo. This demo is present as an example here. You c

Jun 10, 2022

Data Migrator - provide a universal translator for data by being portable, diverse, and efficient in migrating and converting data across discrete schemas

Data Migrator - provide a universal translator for data by being portable, diverse, and efficient in migrating and converting data across discrete schemas

Data Migrator - provide a universal translator for data by being portable, diverse, and efficient in migrating and converting data across discrete schemas

Jan 2, 2023

A flutter demo app to practice Map data structure and its common operations

Map Operations A flutter demo app to practice Map data structure and its common operations Developer Alexander Sosa (https://www.linkedin.com/in/alexa

Jan 3, 2022

A Flutter plugin providing signature pad for drawing smooth signatures.

A Flutter plugin providing signature pad for drawing smooth signatures.

A Flutter plugin providing Signature Pad for drawing smooth signatures. Library is written in pure Dart/Flutter environment to provide support for all

Dec 21, 2022

Peek & Pop implementation for Flutter based on the iOS functionality of the same name.

peek_and_pop Peek & Pop implementation for Flutter based on the iOS functionality of the same name. Finally, the v1.0.0 release! More fluent, more opt

Dec 17, 2022

A Flutter plugin for sharing files & text with other applications.

esys_flutter_share A Flutter plugin for sharing files & text with other applications. IMPORTANT Note for iOS If you are starting a new fresh app, you

Sep 28, 2022
Comments
  • Improve docs for key name on swift side

    Improve docs for key name on swift side

    Hi!

    First of all I would like to thank you for this package: the suiteName parameter specification should be part of official shared_preferences plugin!

    I would only keep your attention on a docs issue: it seems your plugin changes the key name, adding the prefix "flutter." + key_name.

    I think it could be useful for all the other users to add a note on both Readme and pub.dev pages, but also on code docs.

    I lost a couple of days trying to figure out what was wrong with my environment, XCode settings, Apple developer portal app group definitions, etc... Than I saw the last line of your code and... "What the hell?! Am I missing a key prefix???"

    Anyway... Thank you so much for the work, now I can share data from flutter/dart code to Apple Notification Service Extension swift code to manipulate push content 🥳

    opened by simonemarra 1
Owner
null
Startup-Name-Generator-App-in-Flutter - Business Startup Name Generator App in Flutter

Business Startup Name Generator App #About APP: A simple mobile app that generat

AHSAN SIDDZ 0 Jan 30, 2022
An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS

Pusher Flutter Client An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS. Get it from pub. How

HomeX 31 Oct 21, 2022
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022
A productivity suite application built using Flutter and Firebase.

Grasper-App A productivity suite application built using Flutter and Firebase. Getting Started This project is a starting point for a Flutter applicat

null 0 May 22, 2022
A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.

Ably Flutter Plugin A Flutter plugin wrapping the ably-cocoa (iOS) and ably-java (Android) client library SDKs for Ably, the platform that powers sync

Ably Realtime - our client library SDKs and libraries 46 Dec 13, 2022
This is a expenses app which keeps a track of the money spend. Mostly helpful for college students like me...

expenses_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

null 2 Jun 5, 2022
A collection of bricks that I find helpful.

A collection of bricks that I find helpful.

Elijah Luckey 11 Oct 24, 2022
A sophisticated tool for managing queues of asynchronous tasks, with a stream interface, strong typing and lots of helpful options.

Secretary A sophisticated task manager. Secretary is a tool for keeping your futures in check. It's useful for managing queues of asynchronous tasks,

Alex Baker 5 Dec 21, 2022
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

image_editor The version of readme pub and github may be inconsistent, please refer to github. Use native(objc,kotlin) code to handle image data, it i

FlutterCandies 317 Jan 3, 2023
A Flutter plugin for IOS and Android providing a simple way to display PDFs.

Pdf Viewer Plugin A Flutter plugin for IOS and Android providing a simple way to display PDFs. Features: Display PDF. Installation First, add pdf_view

Lucas Britto 56 Sep 26, 2022