preferences 1.2.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new86

preferences

Create Preference Screens easily with advanced features and subpages

Features

  • Easy addition of preferences

  • Subpages

  • Customization options

  • Hide preferences dynamically

  • Reset state on Exception

Installing

You should ensure that you add preferences as a dependency in your flutter project.

dependencies:
  preferences: '^1.2.0'

Then run flutter packages get to get the package.

Usage

Change your main method to

import 'package:preferences/preferences.dart';

main() async {
  await PrefService.init(prefix: 'pref_');
  runApp(MyApp());
}

And then you can use the widgets

return Scaffold(
      appBar: AppBar(
        title: Text('Preferences Demo'),
      ),
      body: PreferencePage([
        PreferenceTitle('General'),
        DropdownPreference(
          'Start Page',
          'start_page',
          defaultVal: 'Timeline',
          values: ['Posts', 'Timeline', 'Private Messages'],
        ),
        PreferenceTitle('Personalization'),
        RadioPreference(
          'Light Theme',
          'light',
          'ui_theme',
          isDefault: true,
        ),
        RadioPreference(
          'Dark Theme',
          'dark',
          'ui_theme',
        ),
      ]),
    );

Look at the example for more information.

[1.2.0] - 20.01.2019

  • Added PreferenceDialog and PreferenceDialogLink
  • Added cache for PrefService to cache values and only apply them when submitting a dialog or confirming a change
  • Added StringList Getter and Setter to PrefService
  • Fixed some issues

[1.1.0] - 17.01.2019

  • Fixed Issue with default RadioPreference being not first

[1.0.8] - 05.01.2019

  • Fixed Issue with PreferenceHider

[1.0.7] - 05.01.2019

  • Fixed Issue with RadioPreference widgets on subpage

[1.0.5] - 05.01.2019

  • DropdownPreference Displayed Values can now be different from saved values
  • PreferencePageLink Page Title can now be different from Link-Label

[1.0.3] - 01.01.2019

  • You can now init PrefService again with a different prefix

[1.0.0] - 31.12.2018

  • Initial release.

example/README.md

preferences_example

An example project for the preferences package

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  preferences: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:preferences/preferences.dart';
  
Version Uploaded Documentation Archive
1.2.0 Jan 20, 2019 Go to the documentation of preferences 1.2.0 Download preferences 1.2.0 archive
1.1.0 Jan 17, 2019 Go to the documentation of preferences 1.1.0 Download preferences 1.1.0 archive
1.0.8 Jan 5, 2019 Go to the documentation of preferences 1.0.8 Download preferences 1.0.8 archive
1.0.7 Jan 5, 2019 Go to the documentation of preferences 1.0.7 Download preferences 1.0.7 archive
1.0.6 Jan 5, 2019 Go to the documentation of preferences 1.0.6 Download preferences 1.0.6 archive
1.0.5 Jan 5, 2019 Go to the documentation of preferences 1.0.5 Download preferences 1.0.5 archive
1.0.3 Jan 1, 2019 Go to the documentation of preferences 1.0.3 Download preferences 1.0.3 archive
1.0.2 Dec 31, 2018 Go to the documentation of preferences 1.0.2 Download preferences 1.0.2 archive
1.0.1 Dec 31, 2018 Go to the documentation of preferences 1.0.1 Download preferences 1.0.1 archive
1.0.0 Dec 31, 2018 Go to the documentation of preferences 1.0.0 Download preferences 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
71
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

We analyzed this package on Jan 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
shared_preferences ^0.4.3 0.4.3
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test