Skip to content

konnic/flutter_shared_preference_app_group

 
 

Repository files navigation

Shared preferences with App Group

pub package

Shared preference supporting iOS App Group capability (using -[NSUserDefaults initWithSuiteName:])

Note: Only support iOS

Usage

To use this plugin, add shared_preference_app_group as a dependency in your pubspec.yaml file.

Example

// The app group must be set up first
await SharedPreferenceAppGroup.setAppGroup(appGroupID);
// Set values using [[NSUserDefaults alloc] initWithSuiteName:appGroupID]
await SharedPreferenceAppGroup.setBool('MY_BOOL_KEY', true);
await SharedPreferenceAppGroup.setString('MY_STRING_KEY', 'STRING_VALUE');
await SharedPreferenceAppGroup.setInt('MY_INT_KEY', 42);
await SharedPreferenceAppGroup.setDouble('MY_DOUBLE_KEY', 9.9);
// Get values
bool boolValue = await SharedPreferenceAppGroup.get('MY_BOOL_KEY');
String stringValue = await SharedPreferenceAppGroup.get('MY_STRING_KEY');
int intValue = await SharedPreferenceAppGroup.get('MY_INT_KEY');
double doubleValue = await SharedPreferenceAppGroup.get('MY_DOUBLE_KEY');

Please see the example app of this plugin for a full example.

Related projects

If you need to implement screen capture, I have developed some helpful plugins:

iOS

ReplayKit Launcher: A flutter plugin of the launcher used to open RPSystemBroadcastPickerView for iOS

Android

MediaProjection Creator: A flutter plugin of the creator used to create MediaProjection instance (with requesting permission) for Android

Another practical demo

https://github.com/zegoim/zego-express-example-screen-capture-flutter

This demo implements screen live broadcast on iOS/Android by using the ZEGO Express Audio and Video Flutter SDK

Contributing

Everyone is welcome to contribute code via pull requests, to help people asking for help, to add to our documentation, or to help out in any other way.

About

Shared preference supporting iOS App Group capability

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 59.5%
  • Objective-C 28.2%
  • Ruby 12.3%