scrollable_panel 0.1.2

  • Readme
  • Changelog
  • Installing
  • 68

scrollable_panel #

drag to expand and then can scroll contents. similar "Nearby spots" panel on google map app.

https://pub.dev/packages/scrollable_panel

Usage #

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final defaultPanelSize = 0.25;
  final maxPanelSize = 1.0;
  PanelController _panelController;
  ValueNotifier<double> _valueNotifier;

  @override
  void initState() {
    super.initState();
    _valueNotifier = ValueNotifier<double>(defaultPanelSize);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Stack(
        children: <Widget>[
          InkWell(
            onTap: () {
              _panelController.toDefault();
            },
            child: _FirstView(),
          ),
          LayoutBuilder(
            builder: (BuildContext context, BoxConstraints constraints) {
              double availablePixels = maxPanelSize * constraints.biggest.height;
              _panelController = PanelController(
                defaultPanelSize: defaultPanelSize,
                maxPanelSize: maxPanelSize,
                availablePixels: availablePixels,
                extent: _valueNotifier,
              );
              return ScrollablePanel(
                controller: _panelController,
                child: _SecondView(),
              );
            }
          )
        ],
      )
    );
  }
}

[0.1.2] - 2019/10/29

  • fix negative velocity

[0.1.1] - 2019/10/23

  • delete debug log

[0.1.0] - 2019/10/22

  • add velocity control and defaultPanelSize

[0.0.3] - 2019/10/18

  • fix bug and example

[0.0.2] - 2019/10/18

  • fix bug and example

[0.0.1] - 2019/10/09

  • initial release.

Use this package as a library

1. Depend on it

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


dependencies:
  scrollable_panel: ^0.1.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:scrollable_panel/scrollable_panel.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
37
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]
68
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

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

Analysis of lib/scrollable_panel.dart reported 1 hint:

line 5 col 8: Don't import implementation files from another package.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and scrollable_panel.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test