Settings Screen with Custom Shared Preference Interface

Overview

flutter_settings_screens

pub package License: MIT

This is a simple flutter plugin for easily creating app settings screens. The unique thing about this library is that it is not dependent upon any specific storage library used to store settings.

Inspired by the shared_preferences_settings plugin.

Now with Null-safety.

Features

  • A collection of settings widgets to make a settings page in a few seconds and get going.
    • Normal:
      • SimpleSettingsTile
      • Switch/Toggle setting
      • Checkbox setting
      • Drop down setting
      • Radio selection Setting
      • Slider setting
      • Color choice panel
      • Text Input Setting
    • Advanced:
      • SettingsScreen:

        A Flutter Widget/Page which can contain all settings widget.

      • ExpandableSettingsTile

        A settings widget which can hold a set of widgets in a section which is collapsible

      • SettingsContainer

      A Settings widget that helps any flutter widget fitting in the settings page

      • SettingsGroup

      A Container widget that creates a section with a title to separate settings inside this from other settings

  • Settings saved via Library of your choice
  • Widgets with conditional visibility of some other settings.
    • for example, A set of settings is only visible if a switch or a checkbox is enabled.

Examples

Initializing the plugin

Initialize the plugin as following:

await Settings.init(cacheProvider: _customCacheProvider);

Note: The plugin must be initialized before Navigating to the settings page.

It is recommended that Settings.init() should be called before runApp() is called in the main file. However, anywhere before showing the settings page is fine.

Cache Provider Interface

Cache Provider is an interface using which the plugin accesses the underlying caching storage.

This plugin includes an implementation of the CacheProvider using the SharedPrerefences library by flutter. if cacheProvider parameter is not given explicitly then the default implementation will be used to store the settings.

However, If you wish to use other means for storing the data, You can implement one by your self.

All you have to do is create a class as following:

import 'package:flutter_settings_screens/flutter_settings_screens.dart';

class CustomCacheProvider extends CacheProvider {
    ///...
    ///implement the methods as you want
    ///...
}

for example,

/// A cache access provider class for shared preferences using shared_preferences library
class SharePreferenceCache extends CacheProvider {
    //...
}

OR

/// A cache access provider class for shared preferences using Hive library
class HiveCache extends CacheProvider {
    //...
}

once you implement the class, use an instance of this class to initialize the Settings class.

Accessing/Retrieving data

You can use static methods of Settings class to access any data from the storage.

Get value:

 Settings.getValue<T>(cacheKey, defaultValue);

Set value(no UI updates):

 await Settings.setValue<T>(cacheKey, newValue);

Set value(with UI updates):

 await Settings.setValue<T>(cacheKey, newValue, notify: true);

T represents any of the following:

  • String
  • bool
  • int
  • double
  • Object

For example if you want to access a String value from the storage: Get value:

 Settings.getValue<String>(cacheKey, defaultValue);

Set value:

 await Settings.setValue<String>(cacheKey, newValue, notify: true);

Special-Note:

Since, Color or MaterialColor is a Flutter object, we need to convert it to string version of the color before saving it to cache & convert string version to color while fetching it from the cache.

For that the plugin exposes ConversionUtils class with utility method to do that needed.

From color to string:

 String colorString = ConversionUtils.stringFromColor(Colors.blue);

From string to color:

 Color color = ConversionUtils.colorFromString('#0000ff');

Tile widgets

SimpleSettingsTile

SimpleSettingsTile is a simple settings tile that can open a new screen by tapping the tile.

Example:

SimpleSettingsTile(
  title: 'Advanced',
  subtitle: 'More, advanced settings.'
  screen: SettingsScreen(
    title: 'Sub menu',
    children: <Widget>[
      CheckboxSettingsTile(
        settingsKey: 'key-of-your-setting',
        title: 'This is a simple Checkbox',
      ),
    ],
  ),
);

SettingsTileGroup

SettingsGroup is a widget that contains multiple settings tiles and other widgets together as a group and shows a title/name of that group.

All the children widget will have small padding from the left and top to provide a sense that they in a separate group from others

Example:

SettingsGroup(
   title: 'Group title',
   children: <Widget>[
      CheckboxSettingsTile(
        settingKey: 'key-day-light-savings',
        title: 'Daylight Time Saving',
        enabledLabel: 'Enabled',
        disabledLabel: 'Disabled',
        leading: Icon(Icons.timelapse),
      ),
      SwitchSettingsTile(
        settingKey: 'key-dark-mode',
        title: 'Dark Mode',
        enabledLabel: 'Enabled',
        disabledLabel: 'Disabled',
        leading: Icon(Icons.palette),
      ),
     ],
 );

ExpandableSettingsTile

ExpandableSettingsTile is a wrapper widget that shows the given children when expanded by clicking on the tile.

Example:

 ExpandableSettingsTile(
   title: 'Quick setting dialog2',
   subtitle: 'Expandable Settings',
   children: <Widget>[
     CheckboxSettingsTile(
       settingKey: 'key-day-light-savings',
       title: 'Daylight Time Saving',
       enabledLabel: 'Enabled',
       disabledLabel: 'Disabled',
       leading: Icon(Icons.timelapse),
     ),
     SwitchSettingsTile(
       settingKey: 'key-dark-mode',
       title: 'Dark Mode',
       enabledLabel: 'Enabled',
       disabledLabel: 'Disabled',
       leading: Icon(Icons.palette),
     ),
   ],
 );

CheckboxSettingsTile

CheckboxSettingsTile is a widget that has a Checkbox with given title, subtitle and default value/status of the Checkbox

This widget supports an additional list of widgets to display when the Checkbox is checked. This optional list of widgets is accessed through childrenIfEnabled property of this widget.

This widget works similar to SwitchSettingsTile.

Example:

 CheckboxSettingsTile(
  leading: Icon(Icons.developer_mode),
  settingKey: 'key-check-box-dev-mode',
  title: 'Developer Settings',
  onChange: (value) {
    debugPrint('key-check-box-dev-mode: $value');
  },
  childrenIfEnabled: <Widget>[
    CheckboxSettingsTile(
      leading: Icon(Icons.adb),
      settingKey: 'key-is-developer',
      title: 'Developer Mode',
      onChange: (value) {
        debugPrint('key-is-developer: $value');
      },
    ),
    SwitchSettingsTile(
      leading: Icon(Icons.usb),
      settingKey: 'key-is-usb-debugging',
      title: 'USB Debugging',
      onChange: (value) {
        debugPrint('key-is-usb-debugging: $value');
      },
    ),
  ],
 );

SwitchSettingsTile

SwitchSettingsTile is a widget that has a Switch with given title, subtitle and default value/status of the switch

This widget supports an additional list of widgets to display when the switch is enabled. This optional list of widgets is accessed through childrenIfEnabled property of this widget.

This widget works similar to CheckboxSettingsTile.

Example:

 SwitchSettingsTile(
  leading: Icon(Icons.developer_mode),
  settingKey: 'key-switch-dev-mode',
  title: 'Developer Settings',
  onChange: (value) {
    debugPrint('key-switch-dev-mod: $value');
  },
  childrenIfEnabled: <Widget>[
    CheckboxSettingsTile(
      leading: Icon(Icons.adb),
      settingKey: 'key-is-developer',
      title: 'Developer Mode',
      onChange: (value) {
        debugPrint('key-is-developer: $value');
      },
    ),
    SwitchSettingsTile(
      leading: Icon(Icons.usb),
      settingKey: 'key-is-usb-debugging',
      title: 'USB Debugging',
      onChange: (value) {
        debugPrint('key-is-usb-debugging: $value');
      },
    ),
    SimpleSettingsTile(
      title: 'Root Settings',
      subtitle: 'These settings is not accessible',
      enabled: false,
    )
  ],
 );

RadioSettingsTile

RadioSettingsTile is a widget that has a list of Radio widgets with given title, subtitle and default/group value which determines which Radio will be selected initially.

This widget supports Any type of values which should be put in the preference.

However, since any type of value is supported, the input for this widget is a Map to the required values with their string representation.

For example, if the required value type is a boolean then the values map can be as following:

<bool, String> {
   true: 'Enabled',
   false: 'Disabled'
}

So, if the Enabled value radio is selected then the value true will be stored in the preference

Complete Example:

RadioSettingsTile<int>(
  title: 'Preferred Sync Period',
  settingKey: 'key-radio-sync-period',
  values: <int, String>{
    0: 'Never',
    1: 'Daily',
    7: 'Weekly',
    15: 'Fortnight',
    30: 'Monthly',
  },
  selected: 0,
  onChange: (value) {
    debugPrint('key-radio-sync-period: $value days');
  },
)

DropDownSettingTile

DropDownSettingsTile is a widget that has a list of DropdownMenuItems with given title, subtitle and default/group value which determines which value will be set to selected initially.

This widget supports Any type of values which should be put in the preference.

However, since any type of value is supported, the input for this widget is a Map to the required values with their string representation.

For example, if the required value type is a boolean then the values map can be as following:

 <bool, String> {
    true: 'Enabled',
    false: 'Disabled'
 }

So, if the Enabled value is selected then the value true will be stored in the preference

Complete Example:

DropDownSettingsTile<int>(
  title: 'E-Mail View',
  settingKey: 'key-dropdown-email-view',
  values: <int, String>{
    2: 'Simple',
    3: 'Adjusted',
    4: 'Normal',
    5: 'Compact',
    6: 'Squizzed',
  },
  selected: 2,
  onChange: (value) {
    debugPrint('key-dropdown-email-view: $value');
  },
);

SliderSettingsTile

SliderSettingsTile is a widget that has a slider given title, subtitle and default value which determines what the slider's position will be set initially.

This widget supports double and integer types of values which should be put in the preference.

Example:

SliderSettingsTile(
 title: 'Volume',
 settingKey: 'key-slider-volume',
 defaultValue: 20,
 min: 0,
 max: 100,
 step: 1,
 leading: Icon(Icons.volume_up),
 onChange: (value) {
   debugPrint('key-slider-volume: $value');
 },
);

Modal widgets

RadioModalSettingsTile

RadioModalSettingsTile widget is the dialog version of the RadioSettingsTile widget.

The use of this widget is similar to the RadioSettingsTile, only the displayed widget will be in a different position.

i.e instead of inside the settings screen, it will be shown in a dialog above the settings screen.

Example:

RadioModalSettingsTile<int>(
  title: 'Preferred Sync Period',
  settingKey: 'key-radio-sync-period',
  values: <int, String>{
    0: 'Never',
    1: 'Daily',
    7: 'Weekly',
    15: 'Fortnight',
    30: 'Monthly',
  },
  selected: 0,
  onChange: (value) {
    debugPrint('key-radio-sync-period: $value days');
  },
);

SliderModalSettingsTile

SliderModalSettingsTile widget is the dialog version of the SliderSettingsTile widget.

The use of this widget is similar to the SliderSettingsTile, only the displayed widget will be in a different position.

i.e instead of inside the settings screen, it will be shown in a dialog above the settings screen.

Example:

SliderSettingsTile(
 title: 'Volume',
 settingKey: 'key-slider-volume',
 defaultValue: 20,
 min: 0,
 max: 100,
 step: 1,
 leading: Icon(Icons.volume_up),
 onChange: (value) {
   debugPrint('key-slider-volume: $value');
 },
);

TextInputSettingsTile

A Setting widget which allows user a text input in a TextFormField.

Example:

TextInputSettingsTile(
  title: 'User Name',
  settingKey: 'key-user-name',
  initialValue: 'admin',
  validator: (String username) {
    if (username != null && username.length > 3) {
      return null;
    }
    return "User Name can't be smaller than 4 letters";
  },
  borderColor: Colors.blueAccent,
  errorColor: Colors.deepOrangeAccent,
);

OR

TextInputSettingsTile(
  title: 'password',
  settingKey: 'key-user-password',
  obscureText: true,
  validator: (String password) {
    if (password != null && password.length > 6) {
      return null;
    }
    return "Password can't be smaller than 7 letters";
  },
  borderColor: Colors.blueAccent,
  errorColor: Colors.deepOrangeAccent,
);

ColorPickerSettingsTile

ColorPickerSettingsTile is a widget which allows user to select a color from a set of Material color choices.

Since, Color is an in-memory object type, the serialized version of the value of this widget will be a Hex value String of the selected color.

For example, If selected color is red then the stored value will be "#ffff0000", but when retrieved, the value will be an instance of Color with properties of red color.

This conversion string <-> color, makes this easy to check/debug the values from the storage/preference manually.

The color panel shown in the widget is provided by the flutter_material_color_picker library.

Example:

 ColorPickerSettingsTile(
   settingKey: 'key-color-picker',
   title: 'Accent Color',
   defaultValue: Colors.blue,
   onChange: (value) {
     debugPrint('key-color-picker: $value');
   },
 );

Utility widgets

SettingsScreen

A simple Screen widget that may contain settings tiles or other widgets. The following example shows how you can create an empty settings screen with a title:

SettingsScreen(
    title: "Application Settings",
    children: [],
);

Inside the children parameter, you can define settings tiles and other widgets. In this example we create a screen with a simple CheckboxSettingsTile in it:

SettingsScreen(
    title: "Application Settings",
    children:
        CheckboxSettingsTile(
            settingKey: 'key-of-your-setting',
            title: 'This is a simple Checkbox',
        ),
    ,
);

SettingsContainer

A widget that helps its child or children to fin in the settings screen. It is helpful if you want to place other widgets than settings tiles in the settings screen body. The following example shows how you can create a container with one Text widget:

SettingsContainer(
    child: Text('Hello world'),
);

In this example, we create a container with multiple Text widgets:

SettingsContainer(
    children:
        Text('First line'),
        Text('Second line'),
    ],
);

Alternate widgets

SimpleRadioSettingsTile

SimpleRadioSettingsTile is a simpler version of the RadioSettingsTile. Instead of a Value-String map, this widget just takes a list of String values.

In this widget, the displayed value and the stored value will be the same.

Example:

SimpleRadioSettingsTile(
  title: 'Sync Settings',
  settingKey: 'key-radio-sync-settings',
  values: <String>[
    'Never',
    'Daily',
    'Weekly',
    'Fortnight',
    'Monthly',
  ],
  selected: 'Daily',
  onChange: (value) {
    debugPrint('key-radio-sync-settings: $value');
  },
);

SimpleDropDownSettingsTile

SimpleDropDownSettingsTile is a simpler version of the DropDownSettingsTile. Instead of a Value-String map, this widget just takes a list of String values.

In this widget, the displayed value and the stored value will be the same.

Example:

SimpleDropDownSettingsTile(
  title: 'Beauty Filter',
  settingKey: 'key-dropdown-beauty-filter',
  values: <String>[
    'Simple',
    'Normal',
    'Little Special',
    'Special',
    'Extra Special',
    'Bizzar',
    'Horrific',
  ],
  selected: 'Special',
  onChange: (value) {
    debugPrint('key-dropdown-beauty-filter: $value');
 },
);

Contribution/Support

  • File an issue on the repository, if something is not working as expected.
    • Please follow the issue template used in flutter-sdk's repository, may be we'll integrate that here as well.
  • File an issue in the repository, If you have any suggestions and/or feature requests, use [Suggestion] or [FeatureRequest] tags in issue titles.
  • To support you just have to help out fellow developers on of the filed issues in this repository.
  • To contribute, just follow the standard open source contributions instructions, maybe we can follow the ones used in the flutter sdk. We'll see how it goes.

All help, issues, support and contributions are most welcome.

Comments
  • Support for later versions of path_provider

    Support for later versions of path_provider

    Really enjoying the plugin, and are using it for my settings screen. However, I am encountering a fairly significant problem. Many of my packages are requiring later versions of path_provider. The maximum supported by flutter_settings_screens appears to be 1.4.4, but the latest version of path_provider is 2.0.1. I am having trouble updating plugins because of this.

    Thanks ~~

    opened by schisms 7
  • SimpleSettingsTile title/subtitle fields don't align with other settings' widgets

    SimpleSettingsTile title/subtitle fields don't align with other settings' widgets

    Hello, I've just started using the library, and it's great!

    I noticed the following issue - the title/subtitle fields of SimpleSettingsTile don't align with other settings' widgets title/subtitle fields when no leading icon is provided to them. In the example below I added SimpleSettingsTile along with a CheckboxSettingsTile and a SwitchSettingsTile to show what I mean:

    Screenshot_20200904-144944

    Same screen below with Debug paint enabled:

    Screenshot_20200904-145023__01

    It seems there is an extra 4 or 8 pixel padding (marked with the arrow) at the beginning of CheckboxSettingsTile and SwitchSettingsTile, so their titles/subtitles don't align with those of SimpleSettingsTile. Is it possible to remove it? I tried to find where the extra padding is coming from but I couldn't find it.

    This is the code I used (btw I'm not using any custom theme if that matters, just ThemeData.dark()):

    SettingsScreen(
      title: "Settings",
      children: [
        SimpleSettingsTile(
          title: "About",
          subtitle: "subtitle",
          onTap: () {},
        ),
        CheckboxSettingsTile(
          settingKey: 'key-setting-checkbox',
          title: 'Checkbox',
          subtitle: "subtitle",
        ),
        SwitchSettingsTile(
          settingKey: "switch-key",
          title: "Switch",
          subtitle: "subtitle",
        )
      ],
    );
    
    opened by msthoma 6
  • Update SettingsTile programatically

    Update SettingsTile programatically

    Hey, I have built an options screen that has a "Reset to Defaults" option on it but I can't get the SettingsTiles to update after resetting the settings to the defaults by using Settings.setValue(). I have the SettingsContainer inside a ChangeNotifier/Consumer which listens to changes to my cacheProvider. Setting the values triggers an update to the Consumer however the SettingsTiles do not change to the new values.

    Is there another way to set the values programatically to update the UI?

    opened by zanesc 6
  • SwitchSettingsTile is stuck after enabling and disabling

    SwitchSettingsTile is stuck after enabling and disabling

    I am trying to use a SwitchSettingsTile with childrenIfEnabled. However, when I enable it, then disable it, I can't enable it again. You can see a screenshot video here- https://www.loom.com/share/bc7e1328ae8a473b8c5b882166d7b4e1 BTW, in the console, for the above video, I get the "device-connected: true" print but it's still seems like disabled.

    SettingsScreen(
      title: "App Settings",
      children: [
        SettingsGroup(
          title: 'Device Details',
          children: <Widget>[
            SwitchSettingsTile(
              settingKey: 'remote-device',
              title: 'Remote Mode',
              defaultValue: true,
              enabledLabel: 'Yes',
              disabledLabel: 'No',
              leading: const Icon(Icons.settings_remote_outlined),
              onChange: (value) {
                logInfo('remote-device: $value');
              },
            ),
            SwitchSettingsTile(
              settingKey: 'device-connected',
              title: 'Is Connected?',
              defaultValue: false,
              enabledLabel: 'Yes',
              disabledLabel: 'No',
              leading: const Icon(Icons.connect_without_contact_outlined),
              onChange: (value) {
                logInfo('device-connected: $value');
              },
              childrenIfEnabled: <Widget>[
                TextInputSettingsTile(
                  settingKey: 'text-settings',
                  title: 'Text Settings',
                  borderColor: Colors.blueAccent,
                  errorColor: Colors.deepOrangeAccent,
                ),
              ],
            ),
          ],
        ),
      ],
    ),
    

    I'm using the latest version (0.3.3-null-safety+1) If someone knows what the problem is, I'll be happy to get some help Thanks

    opened by omerhertz 5
  • Conditional value change

    Conditional value change

    Firstly, thank you for the package! It has been a great help at the beginning of our project.

    In a later phase of our project, we've stumbled upon a missing feature conditional changing of the widget's value. To be more precise, we use a SwitchSettingsTile to manage in-app permissions including the initial request for these permissions. After a user hits the switch we ask him for his permission for the feature and based on the result of the request we want to adjust the widget's value. Currently, when the user denies the permission, the SwitchSettingsTile's value still changes from false (initial value) to true even though the user declines these permissions.

    As a suggested solution, we have added an optional value parameter to some widgets where conditional value changes could become handy. This way we can handle the state from within the parent widget.

    We are unsure if the suggested solution fits your intentions for the package and the coding style you've used. We'd appreciate it if you would take the time to review the PR and if desired propose a solution that is ok with you.

    opened by eddiesTime 5
  • Slider valueChanged only on release

    Slider valueChanged only on release

    Hi, is it possible to support only updating the value in the CustomCacheProvider when the slider is released? I have the CustomCacheProvider hooked up to network calls that update data on my server but it updates it for every increment in the slider which is not good for my use case. I know in iOS with swift you can accomplish this by setting mySlider.isContinuous = false.

    opened by zanesc 5
  • Clicking CANCEL on TextInputSettingsTile causes an Exception to be thrown

    Clicking CANCEL on TextInputSettingsTile causes an Exception to be thrown

    When clicking on the TextInputSettingsTile and then clicking on CANCEL, an Exception is being thrown. You can see a usage example here- https://www.loom.com/share/74c0debe974f4abe9265470a87994cce

    I think the problem is in The Exception is:

    ======== Exception caught by gesture ===============================================================
    The following _Exception was thrown while handling a gesture:
    Exception: No Implementation Found
    
    When the exception was thrown, this was the stack: 
    #0      SharePreferenceCache.getValue (package:flutter_settings_screens/src/cache/cache_provider_impl.dart:111:5)
    #1      Settings.getValue (package:flutter_settings_screens/src/settings.dart:100:27)
    #2      _TextInputSettingsTileState.build.<anonymous closure>.<anonymous closure> (package:flutter_settings_screens/src/widgets/settings_widgets.dart:593:41)
    #3      __ModalSettingsTileState._addActionWidgets.<anonymous closure> (package:flutter_settings_screens/src/widgets/base_widgets.dart:482:30)
    #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:1005:21)
    #5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
    #6      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:613:11)
    #7      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:298:5)
    #8      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:232:7)
    #9      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:563:9)
    #10     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)
    #11     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:139:9)
    #12     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:614:13)
    #13     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)
    #14     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:123:7)
    #15     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:445:19)
    #16     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:425:22)
    #17     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:329:11)
    #18     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:380:7)
    #19     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:344:5)
    #20     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:302:7)
    #21     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:285:7)
    #25     _invoke1 (dart:ui/hooks.dart:170:10)
    #26     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
    #27     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
    (elided 3 frames from dart:async)
    Handler: "onTap"
    Recognizer: TapGestureRecognizer#0201e
      debugOwner: GestureDetector
      state: possible
      won arena
      finalPosition: Offset(536.5, 243.5)
      finalLocalPosition: Offset(28.5, 18.5)
      button: 1
      sent tap down
    

    This is my settings implementation:

    SettingsScreen(
      title: "App Settings",
      children: [
        SettingsGroup(
          title: 'Device Details',
          children: <Widget>[
            SwitchSettingsTile(
              settingKey: 'remote-device',
              title: 'Remote Mode',
              defaultValue: true,
              enabledLabel: 'Yes',
              disabledLabel: 'No',
              leading: const Icon(Icons.settings_remote_outlined),
              onChange: (value) {
                logInfo('remote-device: $value');
              },
            ),
            SwitchSettingsTile(
              settingKey: 'device-connected',
              title: 'Is Connected?',
              defaultValue: false,
              enabledLabel: 'Yes',
              disabledLabel: 'No',
              leading: const Icon(Icons.connect_without_contact_outlined),
              onChange: (value) {
                logInfo('device-connected: $value');
              },
              childrenIfEnabled: <Widget>[
                TextInputSettingsTile(
                  settingKey: 'text-settings',
                  title: 'Text Settings',
                  borderColor: Colors.blueAccent,
                  errorColor: Colors.deepOrangeAccent,
                ),
              ],
            ),
          ],
        ),
      ],
    );
    

    I'm using version 0.3.3-null-safety+1

    opened by omerhertz 4
  • 0.3.2-null-safety complaints about unnecessary WidgetsBinding.instance? null check.

    0.3.2-null-safety complaints about unnecessary WidgetsBinding.instance? null check.

    Getting theese warnings:

    /C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_settings_screens-0.3.2-null-safety/lib/src/widgets/settings_widgets.dart:613:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
     - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
        WidgetsBinding.instance?.addPostFrameCallback((_) {
                       ^
    DartUri: Unresolved uri: dart:web_sql
    DartUri: Unresolved uri: dart:ui
    

    Any hope for null safe release which addresses this particular problem ?

    opened by RoarGronmo 4
  • flutter_settings_screens not null safety

    flutter_settings_screens not null safety

    Null safety is not supported. It gives the following error in current flutter version

    Error: Cannot run with sound null safety, because the following dependencies
    don't support null safety:
     - package:flutter_settings_screens
    
    opened by Aleynaesr 4
  • Add adaptive widgets and Add more usable settings screen

    Add adaptive widgets and Add more usable settings screen

    • Add adaptive switches for IOS devices in lib/src/settings_screen.dart and example/lib/main.dart.
    • Add an adaptive slider for IOS devices in lib/src/settings_screen.dart.
    • Modified Scaffold to ensure easy implementation with Scaffold-ready screens in lib/src/settings_screen.dart.
    • Add drawer and endDrawer to the settings screen Scaffold in lib/src/settings_screen.dart.
    • Add isMainScreen as an optional argument to SettingsScreen widget in lib/src/settings_screen.dart; to give the developer the choice between having a ready setting screen or just rendering the settings screen widgets with no Scaffold or AppBar.
    opened by AhmedAbouelkher 4
  • Title sizes differ on SimpleSettings Widgets

    Title sizes differ on SimpleSettings Widgets

    I have a SwitchSettingsTile and a SliderSettingsTile set and they both have different title font sizes. It would be great if the title size remained the same or if there was a custom property to set them.

    SwitchSettingsTile( title: 'Sound Effects', settingKey: 'soundEffects', leading: Icon(Icons.audiotrack), onChange: (bool value) async { }, ), SliderSettingsTile( title: 'Sound Effect Volume', leading: Icon(Icons.audiotrack), settingKey: 'soundEffectVolume', defaultValue: 0.5, min: 0, max: 1, step: 0.01, onChange: (double value) async { }, ),

    Screenshot_20200618_200250_com apphoss allfourslime

    opened by zanesc 4
  • notification bug

    notification bug

    I just created a pull request to fix a bug in notifications: any settings with a settingKey containing uppercase letters weren't automatically updated - bug fixed.

    This pull request also contains an optional colors parameter for ColorPickerSettingsTile for users to provide their own selection of color swatches.

    Cheers,

    Torsten

    opened by ToH2002 0
  • notification bugfix and colors parameter

    notification bugfix and colors parameter

    Hi there, I created a branch in order to fix a notification bug: notifications didn't affect tiles with a key that contained upper-case letters due to a "ToLower" in the function that lists the tiles to be notified. Since I generally use camelCase to name keys, this created issues.

    Also, I added a parameter "colors" to ColorPickerSettingsTile, so users can choose their own color selection.

    All other changes are just automatic formatting made by VSCode - sorry about that...

    Hope you can incorporate this!

    opened by ToH2002 0
  • DropDownSettingsTile with Larg content string is get size error

    DropDownSettingsTile with Larg content string is get size error

    DropDownSettingsTile Failed assertion: line 1210 pos 7: 'tileWidth != trailingSize.width || tileWidth == 0.0': Trailing widget consumes entire tile width. please fix with auto size

    this is what i did actually.


    class _DropDownSettingsTileNewState extends State<DropDownSettingsTileNew> { T selectedValue;

    @override void initState() { super.initState(); selectedValue = widget.selected; }

    @override Widget build(BuildContext context) { return ValueChangeObserver( cacheKey: widget.settingKey, defaultValue: selectedValue, builder: (BuildContext context, T value, OnChanged onChanged) { return SettingsContainer( children: [ _SettingsTile( title: widget.title, subtitle: widget.subtitle, enabled: widget.enabled, showChildBelow: true, //changed to true so it's getting next line

    so add this as a parameter of DropDownSettingsTile

    opened by safvanp 0
  • Fix: Subtitle in RadioModalSettingsTile was not changing after more than two opens.

    Fix: Subtitle in RadioModalSettingsTile was not changing after more than two opens.

    This commit solved this and this, but there was still a little problem with not updating subtitle in RadioModalSettingsTile after more than two opens. Check the video.

    But I do not know, if this line was important for some other stuff like handling memory leaks, so merge with caution.

    opened by Juggler98 1
  • RTL bug in SettingsGroup

    RTL bug in SettingsGroup

    Hello, there is a problem in the rtl and in the SettingsGroup widget . Here, instead of using Alignment.centerLeft, AlignmentDirectional.centerStart should be used !

    Screenshot

    image

    opened by mbfakourii 7
Owner
Harshvardhan Joshi
Summary : Curious Guy > Flutter Developer > Android Developer > TechGeek > Regular Gamer, I play games for story/experience not compitition
Harshvardhan Joshi
Flutter Settings Screen with Shared Preferences

Settings Screen with Shared Preferences A library that provides an easy solution to create settings screens with simple and compound options. Features

Barnabás BARTHA 66 Sep 27, 2022
Flutter settings manager built on top of Shared Preferences

Settings Manager Flutter settings store built on top of shared preferences. Code Generator for supported types Usage import 'dart:async'; import 'pac

Rody Davis 17 Dec 13, 2022
This example uses a ScrollView, JSON Rest API, Navigation, Alert Pop Up, Progress Indicator, Globals, Images in a shared asset folder, and 100% Shared Code

This example uses a ScrollView, JSON Rest API, Navigation, Alert Pop Up, Progress Indicator, Globals, Images in a shared asset folder, and 100% Shared Code. Now with the ability to login with FaceID, TouchID, and Fingerprint Reader on Android.

Rody Davis 672 Jan 6, 2023
Shared preferences typed - A type-safe wrapper around shared preferences, inspired by ts-localstorage

Typed Shared Preferences A type-safe wrapper around shared_preferences, inspired

Philipp Bauer 0 Jan 31, 2022
Note Shared Preferences - Note App Shared Preferences, Using Flutter

NOTE APP SHARED PREFERENCES LOCALIZATION Watch the gif below (lasts 00:08:22)

Tukhtamurodov Sardorbek 1 Jul 8, 2022
A Flutter project created for test purposes based on the wallet settings screen of the polkadex mobile app.

polkadex_mobile_test A Flutter project created for test purposes based on the wallet settings screen of the polkadex mobile app. Getting Started This

null 0 Jan 10, 2022
Doctor Consultation App in Flutter containing splash screen on boarding screen Routing state management Dash board Bottom navigation Decorated Drawer and Doctors Screen in the last.

Online doctor Consultation App UI in Flutter Doctor Consultation App UI in Flutter Visit Website Features State Management Navigation Bar Responsive D

Habib ullah 14 Jan 1, 2023
Android test task master - Create PIN code screen, authentication by PIN code screen and menu screen

Here is described test tasks for a android dev. Need to implement three screens:

null 3 Oct 4, 2022
A Flutter widget to create an iOS settings-table (static TableView).

flutter_cupertino_settings A Flutter widget to create an iOS settings-table (static TableView). import 'package:flutter_cupertino_settings/flutter_cup

Matthias Rupp 234 Dec 28, 2022
An Ubuntu desktop settings app made with Flutter

unofficial Ubuntu Desktop Settings App made with Flutter - WIP TODO use real yaru icons - thanks to @Jupi007 improve layout implement settings search

Frederik Feichtmeier 236 Dec 15, 2022
Navigation the Multiple Screens ( All categories and Favourites Screens ) and add settings to sort the meals based on categories

meals_app Navigation the Multiple Screens ( All categories and Favourites Screens ) and add settings to sort the meals based on categories Getting Sta

Avinash Poshiya 1 Nov 29, 2021
With cupertino_setting_control you can create a settings page or a simple form very easy.

Flutter Cupertino Setting Control With cupertino_setting_control you can create a settings page or a simple form very easy. Therefore, cupertino_setti

Christoph Rothermel 7 Mar 28, 2022
A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity

Flutter Ready to Go A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity. Why

null 139 Nov 11, 2022
Create native settings for Flutter app in a minutes.

Settings UI for Flutter Installing: In your pubspec.yaml dependencies: settings_ui: ^1.0.1 import 'package:settings_ui/settings_ui.dart'; Basic Usag

Yako 716 Dec 29, 2022
Arissettingsmenuexm - Settings Menu with different choices by clicking on a Popup Menu Button in Flutter

Flutter Tutorial - Settings Menu & AppBar Dropdown Menu Show a Flutter Settings

Behruz Hurramov 1 Jan 9, 2022
Fluttersettingsui - Fork of settingsui. Create native settings for Flutter app in a minutes.

Settings UI for Flutter Installing: In your pubspec.yaml dependencies: flutter_settings_ui: ^1.0.1 import 'package:flutter_settings_ui/flutter_setti

Julian Steenbakker 22 Oct 24, 2022
Boilerplate codes including Superbase settings for Flutter

flutter_boilerplate_supabase Boilerplate codes including Superbase settings for Flutter. Getting Started You have to create the .env file. Rename the

Flutter Seoul 2 Feb 7, 2022
My flutter (android, ios) UI design examples 🎈 - user profile UIs, food order ui, splashscreen, mask widget usage, settings page ui

Flutter UI Design Examples ?? This repository contains the flutter ui designs I designed while learning. Doctor Appointment App UI Packages in use: fl

Aleyna Eser 23 Nov 14, 2022
A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper on Android devices.

wallpaper_manager A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper(s) on Android devices. Usage Installation In the pubs

Aditya Mulgundkar 38 Nov 28, 2022