digit_ui_components 0.0.2-dev.3 copy "digit_ui_components: ^0.0.2-dev.3" to clipboard
digit_ui_components: ^0.0.2-dev.3 copied to clipboard

Digit UI Design specification

digit ui components #

Flutter Common UI Widgets #

Digit UI Components is a collection of common Flutter widgets designed to simplify UI development. These components offer easy-to-use and customizable features to enhance UI design and streamline the development process.

Installation #

Add this to your pubspec.yaml file:

dependencies:
  digit_ui_components: 1.0.0

Then run:

   flutter pub get

Usage #

Import the package in your Dart code:

   import 'package:digit_ui_components/digit_components.dart';

Example #

Text Input Variants #

Digit UI Components includes various text input fields with optional features such as character count display, inner labels, and help text. These fields also come with built-in validation support for improved data integrity.

Text Input Field

    DigitTextFormInput(
        label: "Text Field",
        initialValue: 'value',
        controller: TextEditingController(),
        innerLabel: 'label',
        helpText: 'help text',
        charCount: true,
    );

text-field

Date Input Field

    DigitDateFormInput(
        label: "Date Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
    );

date-field-1

date

date-1

Time Input Field

    DigitTimeFormInput(
        label: "Time Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
    );

time-field-1

time

time-1

Location Input Field

    DigitLocationFormInput(
        label: "Location Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
    );

location

location-1

Numeric Input Field
    DigitNumericFormInput(
        label: "Numeric Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
        initialValue: '0',
        step: 1,
    );

numeric

Password Input Field

    DigitPasswordFormInput(
        label: "password Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
        validations: [
            Validator(ValidatorType.minLength, 6,
            errorMessage:
            'Password must be at least 6 characters.'),
        ],
    );

password-1

password-2

Search Input Field

    DigitSearchFormInput(
        label: "Search Field",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
        onSuffixTap: (value){},
    );

search

TextArea Input Field

    DigitTextAreaFormInput(
        label: "Text Area",
        controller: TextEditingController(),
        innerLabel: 'innerlabel',
        helpText: 'help text',
    );

textArea

DigitButton Variants #

Digit UI Components provides a variety of DigitButtons with optional suffix and prefix icons, contributing to a cohesive and visually appealing UI.

Primary DigitButton

    DigitButton(
        label: 'Primary DigitButton',
        onPressed: () {},
        type: DigitButtonType.primary,
    );

primary-DigitButton

with Suffix Icon

    DigitButton(
        suffixIcon: Icons.add,
        label: 'Primary DigitButton',
        onPressed: () {},
        type: DigitButtonType.primary,
    );

primary-DigitButton-1

Secondary DigitButton

    DigitButton(
        label: 'secondary DigitButton',
        onPressed: () {},
        type: DigitButtonType.secondary,
    );

secondary-DigitButton

Tertiary DigitButton

    DigitButton(
        label: 'tertiary DigitButton',
        onPressed: () {},
        type: DigitButtonType.tertiary,
    );

tertiary-DigitButton

    DigitButton(
        label: 'link',
        onPressed: () {},
        type: DigitButtonType.link,
    );

link

Radio DigitButtons #

The Radio DigitButtons component in Digit UI Components empowers users to make a single selection from a list of options. This intuitive interface provides a smooth user experience with hover and mouse-down effects.

    RadioList(
        onChanged: (value) {},
        groupValue: '1',
        radioDigitButtons: [
            RadioDigitButtonModel(code: '1',name: 'One',),
            RadioDigitButtonModel(code: '2', name: 'Two'),
            RadioDigitButtonModel(code: '3', name: 'Three'),
        ],
    );

radio

Toggle DigitButtons #

The Toggle DigitButtons component in Digit UI Components presents a list of interactive toggle DigitButtons, providing users with the ability to select a option. Each DigitButton is equipped with callbacks for both mouse-down and hover effects, ensuring a responsive and engaging user interface.

    ToggleList(
        toggleDigitButtons: [
            ToggleDigitButtonModel(
                name: 'Toggle 1', key: 'key1', onSelected: (value) {}),
            ToggleDigitButtonModel(
                name: 'Toggle 2', key: 'key2', onSelected: (value) {}),
            ToggleDigitButtonModel(
                name: 'Toggle 3', key: 'key3', onSelected: (value) {}),
            ],
        selectedIndex: 1,
        onChanged: (selectedValues) {},
    );

toggle-list

Digit UI Components offers various dropdown menus, including single-select, multi-select, and tree-select options.

Single Select Dropdown

The Single Select Dropdown in Digit UI Components provides a dropdown menu for users to make a single selection. This intuitive component supports options with additional features such as images, icons, and descriptions, complemented by hover and mouse-down effects.

DigitDropdown<int>(
    onChange: (String value, String index) => {},
    textEditingController: TextEditingController(),
    items: const [
        DropdownItem(name: 'first',code: '1',),
        DropdownItem(name: 'second',code: '2',),
        DropdownItem(name: 'third',code: '3',),
        DropdownItem(name: 'fourth',code: '4',
        ),
    ],
);

simple-dropdown

simple-dropdown-1

With description and profile Image

DigitDropdown<int>(
    onChange: (String value, String index) => {},
    textEditingController: TextEditingController(),
    items: const [
        DropdownItem(
            name: 'first',
            code: '1',
            description: 'description for first one',
            profileImage: NetworkImage(
                'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzBXNuO6PezhC18aYH_2cYtS0I7KbxoKYdwA&usqp=CAU',
            ),
        ),
        DropdownItem(
            name: 'second',
            code: '2',
            description: 'description for second one',
            profileImage: NetworkImage(
                'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzBXNuO6PezhC18aYH_2cYtS0I7KbxoKYdwA&usqp=CAU',
            ),
        ),
        DropdownItem(
            name: 'third',
            code: '3',
            description: 'description for third one',
            profileImage: NetworkImage(
                'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzBXNuO6PezhC18aYH_2cYtS0I7KbxoKYdwA&usqp=CAU',
            ),
        ),
        DropdownItem(
            name: 'fourth',
            code: '4',
            description: 'description for fourth one',
            profileImage: NetworkImage(
                'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzBXNuO6PezhC18aYH_2cYtS0I7KbxoKYdwA&usqp=CAU',
            ),
        ),
    ],
);

simple-dropdown-variation

With Different Type of Options

DigitDropdown<int>(
    onChange: (String value, String index) => {},
    textEditingController: TextEditingController(),
    dropdownType: DropdownType.nestedSelect,
    items: const [
        DropdownItem(name: 'first',code: '1',type: 'Type A',),
        DropdownItem(name: 'second',code: '2',type: 'Type B'),
        DropdownItem(name: 'third',code: '3',type: 'Type A',),
        DropdownItem(name: 'fourth',code: '4',type: 'Type B'),
    ],
);

dropdown-type

Multi Select Dropdown

The Multi Select Dropdown in Digit UI Components offers a user-friendly interface for selecting multiple options simultaneously. This clean and intuitive component is equipped with built-in chips and provides responsive mouse-down and hover effects.

MultiSelectDropDown<int>(
    onOptionSelected: (List<DropdownItem> selectedOptions) {},
    options: const [
        DropdownItem(code: '1', name: 'first'),
        DropdownItem(code: '2', name: 'second'),
        DropdownItem(code: '3', name: 'third'),
        DropdownItem(code: '4', name: 'four'),
    ],
);

multiselect

multiselect-1

Tree Select Dropdown

A hierarchical dropdown menu enabling single or multiple selections from a tree-like structure.

Single Select Option

TreeSelectDropDown<int>(
    onOptionSelected: (List<TreeNode> selectedOptions) {},
    options: [
        TreeNode('C', 'C', [
            TreeNode('C.C1', 'C1', []),
            TreeNode('C.C2', 'C2', []),
        ]),
        TreeNode('D', 'D', [
            TreeNode('D.D1', 'D1', []),
            TreeNode('D.D2', 'D2', []),
        ]),
    ],
    controller: TreeSelectController(),
);

tree-select

tree-select-1

Multi Select Option

TreeSelectDropDown<int>(
    onOptionSelected: (List<TreeNode> selectedOptions) {},
    options: [
        TreeNode('C', 'C', [
            TreeNode('C.C1', 'C1', []),
            TreeNode('C.C2', 'C2', []),
        ]),
        TreeNode('D', 'D', [
            TreeNode('D.D1', 'D1', []),
            TreeNode('D.D2', 'D2', []),
        ]),
    ],
    treeSelectionType: TreeSelectionType.MultiSelect,
    controller: TreeSelectController(),
);

tree-multiselect

tree-multiselect-1

Toast #

The toast component is used for displaying toast messages with various types such as success, error, and warning.

Success toast

    Toast.show(context,
                      options: ToastOptions(
                          "Your Warning message", ToastType.success));

Screenshot from 2024-03-11 14-32-23

error toast

    Toast.show(context,
                    options: ToastOptions(
                        "Your Warning message", ToastType.error));

Screenshot from 2024-03-11 14-32-28

Warning toast

    Toast.show(context,
                        options: ToastOptions(
                            "Your Warning message", ToastType.warning));

Screenshot from 2024-03-11 14-32-34

Info Card #

InfoCard is a versatile widget designed to showcase informational content in a visually appealing manner. It is commonly used to display messages, alerts, or other important information. The card supports various customization options to adapt to different use cases.

Info card

    InfoCard(
              title: 'Info',
              type: InfoType.info,
              description:
              'Application process will take a minute to complete. It might cost around Rs.500/- to Rs.1000/- to clean your septic tank and you can expect theservice to get completed in 24 hrs from the time of payment.',
            ),

Screenshot from 2024-03-11 14-39-56

Success card

    InfoCard(
              title: 'Success',
              type: InfoType.success,
              description:
              'Application process will take a minute to complete. It might cost around Rs.500/- to Rs.1000/- to clean your septic tank and you can expect theservice to get completed in 24 hrs from the time of payment.',
            ),

Screenshot from 2024-03-11 14-40-34

Warning card

   InfoCard(
              title: 'Warning',
              type: InfoType.warning,
              description:
              'Application process will take a minute to complete. It might cost around Rs.500/- to Rs.1000/- to clean your septic tank and you can expect theservice to get completed in 24 hrs from the time of payment.',
            ),

Screenshot from 2024-03-11 14-41-10

Error card

    InfoCard(
            title: 'Error',
            type: InfoType.error,
            description:
            'Application process will take a minute to complete. It might cost around Rs.500/- to Rs.1000/- to clean your septic tank and you can expect theservice to get completed in 24 hrs from the time of payment.',
            ),

Screenshot from 2024-03-11 14-40-57

License #

MIT

Logo