direct_select_flutter 1.0.2

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

direct-select-flutter #

DirectSelect is a selection widget with an ethereal, full-screen modal popup displaying the available choices when the widget is interact with. https://dribbble.com/shots/3876250-DirectSelect-Dropdown-ux

iOS #

Android #

Usage #

Create DirectSelectList and fill it with items using itemBuilder

    final dsl = DirectSelectList<String>(
        values: _cities,
        defaultItemIndex: 3,
        itemBuilder: (String value) => getDropDownMenuItem(value),
        focusedItemDecoration: _getDslDecoration(),
        onItemSelectedListener: (item, index, context) {
          Scaffold.of(context).showSnackBar(SnackBar(content: Text(item)));
        });

Create items like this

  DirectSelectItem<String> getDropDownMenuItem(String value) {
    return DirectSelectItem<String>(
        itemHeight: 56,
        value: value,
        itemBuilder: (context, value) {
          return Text(value);
        });
  }

Create decorations for focused items

   _getDslDecoration() {
    return BoxDecoration(
      border: BorderDirectional(
        bottom: BorderSide(width: 1, color: Colors.black12),
        top: BorderSide(width: 1, color: Colors.black12),
      ),
    );
  }

Create DirectSelectContainer and fill it with your data

Scaffold(
      appBar: appBar,
      body: DirectSelectContainer(
        controls: [dsl, dsl2],
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            verticalDirection: VerticalDirection.down,
            children: <Widget>[
              SizedBox(height: 150.0),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: Column(
                  children: <Widget>[
                    Container(
                        alignment: AlignmentDirectional.centerStart,
                        margin: EdgeInsets.only(left: 4),
                        child: Text("City")),
                    Padding(
                      padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
                      child: Card(
                          child: Row(
                            mainAxisSize: MainAxisSize.max,
                            children: <Widget>[
                              Expanded(
                                  child: Padding(
                                      child: dsl,
                                      padding: EdgeInsets.only(left: 12))),
                              Padding(
                                padding: EdgeInsets.only(right: 8),
                                child: Icon(
                                  Icons.unfold_more,
                                  color: Colors.black38,
                                ),
                              )
                            ],
                          )),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );

1.0.0 #

  • Initial Open Source release.

1.0.2 #

  • Horizontal scroll problem fix
  • Scale down small overlay problem resolved

example/README.md

example #

Demonstrates how to use the flutter_direct_select.

Use this package as a library

1. Depend on it

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


dependencies:
  direct_select_flutter: ^1.0.2

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:direct_select_flutter/direct_select_container.dart';
import 'package:direct_select_flutter/direct_select_item.dart';
import 'package:direct_select_flutter/direct_select_list.dart';
  
Version Uploaded Documentation Archive
1.0.2 Mar 20, 2019 Go to the documentation of direct_select_flutter 1.0.2 Download direct_select_flutter 1.0.2 archive
1.0.1 Mar 20, 2019 Go to the documentation of direct_select_flutter 1.0.1 Download direct_select_flutter 1.0.1 archive
1.0.0 Mar 19, 2019 Go to the documentation of direct_select_flutter 1.0.0 Download direct_select_flutter 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
46
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/direct_select_container.dart. (-0.50 points)

Analysis of lib/direct_select_container.dart reported 1 hint:

line 223 col 58: The member 'positions' can only be used within instance members of subclasses of 'package:flutter/src/widgets/scroll_controller.dart'.

Fix lib/direct_select_list.dart. (-0.50 points)

Analysis of lib/direct_select_list.dart reported 1 hint:

line 19 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: DirectSelectList.onTapEventListener, DirectSelectList.onDragEventListener, DirectSelectList.paddingGlobalKey

Format lib/direct_select_item.dart.

Run flutter format to format lib/direct_select_item.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
rect_getter ^0.0.1 0.0.1
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