GithubHelp home page GithubHelp logo

phuongpt / flutter-settings-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yako-dev/flutter-settings-ui

0.0 1.0 0.0 17.02 MB

Create native settings for Flutter app in a minutes.

Home Page: https://pub.dev/packages/settings_ui

License: Apache License 2.0

Ruby 1.25% C++ 15.54% C 0.68% Objective-C 0.03% Kotlin 0.11% Dart 74.51% Swift 0.37% HTML 0.17% CMake 7.33%

flutter-settings-ui's Introduction

Settings UI for Flutter

Pub Version

Overview:

Build the beautiful settings screen UI in one moment with Settings UI for Flutter



Installing:

  1. Add the dependency in your pubspec.yaml file.
dependencies:  
 settings_ui: <latest version>
  1. Import the settings_ui package.
import 'package:settings_ui/settings_ui.dart';


Basic Usage:

    SettingsList(
      sections: [
        SettingsSection(
          title: Text('Common'),
          tiles: <SettingsTile>[
            SettingsTile.navigation(
              leading: Icon(Icons.language),
              title: Text('Language'),
              value: Text('English'),
            ),
            SettingsTile.switchTile(
              onToggle: (value) {},
              initialValue: true,
              leading: Icon(Icons.format_paint),
              title: Text('Enable custom theme'),
            ),
          ],
        ),
      ],
    ),



Settings List

Settings list it's a wrapper for your settings UI.

Parameters

Parameter Description Required
List<AbstractSettingsSection> sections The list of your settings sections +
bool shrinkWrap Enable/disable the shrink wrap for the list -
ScrollPhysics physics Setup your custom scroll physics -
DevicePlatform platform Chose the platform view you prefer -
SettingsThemeData lightTheme Setup your light theme -
SettingsThemeData darkTheme Setup your dark theme -
Brightness brightness Overwrite the brightness you want -
EdgeInsetsGeometry contentPadding Set custom paddings -
ApplicationType applicationType Setup the application type you use: the material for MaterialApp, the cupertino for CupertinoApp, and the both, if you running the MaterialApp and the CupertinoApp depending on the device's OC -




Settings Section

The Setting section is the block of your settings tiles located in your SettingsList.

Implementations

Type Description
AbstractSettingsSection An abstract entity. Just an OOP's thing (so you can expand it yourself)
CustomSettingsSection You asked a lot. We implemented this for you. Now you can put anything you want as a child inside this custom section. Just paste the image of your cat or the weather widget inside the SettingsList. Feel free and enjoy
SettingsSection The default section widget, contains Widget title, EdgeInsetsDirectional margin and the required list of AbstractSettingsTile we called tiles




Settings Tile

Here it is. The section tile. It displays the elements you want to show.

Type Description
AbstractSettingsTile One more OOP's thing (so you can expand it yourself)
CustomSettingsTile The main idea is the same as for the CustomSettingsSection. You can put anything as a child inside your SettingsSection.
SettingsTile I think that we need to discuss this deeper. See below for the details.


Settings tile

The implementation of AbstractSettingsTile. It has a lot of fabric methods and parameters. Let's take a look.

Constructor / Fabric method Description
SettingsTile Displays the default setting tile. Nothing special.
SettingsTile.navigation Created to indicate this tile as a navigation tile. It adds a right-located arrow for the iOS design as an example.
SettingsTile.switchTile Creates a switch tile. Do you want some switch? Just use this one.


Now let's deal with all these parameters.

Parameter Description
Widget leading Adds some leading for your tile. Just like with the ListTile.
Widget trailing Adds some trailing for your tile. Just like with the ListTile.
Widget title The title of your tile.
Widget description Additional info about this tile. Displays different ways according to the platform
Function(BuildContext context) onPressed More interactivity for your tiles. Just tap it.
Color activeSwitchColor Set the switch color for your SettingsTile.switchTile
Widget value Just like the description but more declarative. You can compare and choose which exactly you want to use.
Function(bool value) onToggle Override the on switch event in your SettingsTile.switchTile
bool initialValue Choose the initial value for your SettingsTile.switchTile
bool enabled Mark your tile as disabled. It's pretty easy!




License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

flutter-settings-ui's People

Contributors

akora-ingdkb avatar arthurdenner avatar asakahara avatar cpdunphy avatar ejprok avatar ekurkel avatar he0119 avatar juliansteenbakker avatar m-ixai-l avatar mrkajetanp avatar mrquentin avatar noordawod avatar phuongpt avatar preetjdp avatar yadaniyil avatar zeusbaba avatar zigapovhe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.