bidirectional_scroll_view 0.0.6

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

bidirectional_scroll_view

This package for Flutter allows you to scroll in both horizontal and vertical directions.

It works as follows:

    new BidirectionalScrollViewPlugin(child: <replace with your own widget>)

Support

Please file issues and feature requests.

[0.0.5]

  • NEW: Add ability to set the x and y offset of scroll view
  • NEW: Add getter methods for x and y scroll values
  • NEW: Add getter methods for overscrolled widget width and height
  • NEW: Add getter methods for container that holds the overscrolled widget width and height

[0.0.4]

  • NEW: Add optional listener for x and y scroll values
  • NEW: Add velocityFactor to make fling velocity configurable
  • FIX: Prevent fling and gesture animation mixing up

[0.0.3]

  • NEW: Bring project files to root level

[0.0.2]

  • NEW: Add Flutter mention to project

[0.0.1]

  • NEW: Initial Release.

example/lib/main.dart

import 'package:bidirectional_scroll_view/bidirectional_scroll_view.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  BidirectionalScrollViewPlugin _plugin;


  @override
  void initState() {
    super.initState();
    _plugin = new BidirectionalScrollViewPlugin(
      child: _buildWidgets(),
      velocityFactor: 2.0,
      scrollListener: (offset) {
        print("----------");
        print("new x and y scroll offset: " + offset.dx.toString() + " " + offset.dy.toString());
        print("x and y scroll offset getters: " + _plugin.x.toString() + " " + _plugin.y.toString());
        print("height and width of overscrolled widget: " + _plugin.height.toString() + " " + _plugin.width.toString());
        print("height and width of the container: " + _plugin.containerHeight.toString() + " " + _plugin.containerWidth.toString());
        print("----------");
      },
    );

    //_plugin.offset = new Offset(10.0, 10.0); // use this method to set a new offset where appropriate
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Bidirectional ScrollView Plugin'),
        ),
        body: new Center(
          child: _plugin
        ),
      ),
    );
  }

  Widget _buildWidgets() {
    List<Widget> list = new List();

    for (int i = 0; i < 10; i++) {
      list.add(new Container(
        padding: new EdgeInsets.all(5.0),
        color: Colors.white,
        height: 80.0,
        width: 120.0,
        child: new Container(
          color: Colors.grey,
        ),
      ));
    }

    return new Row(
      children: [
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
        new Column(
          children: list.map((widget) {
            return widget;
          }).toList(),
        ),
      ],
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  bidirectional_scroll_view: ^0.0.6

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:bidirectional_scroll_view/bidirectional_scroll_view.dart';
  
Version Uploaded Documentation Archive
0.0.6 Oct 19, 2018 Go to the documentation of bidirectional_scroll_view 0.0.6 Download bidirectional_scroll_view 0.0.6 archive
0.0.5 Jul 30, 2017 Go to the documentation of bidirectional_scroll_view 0.0.5 Download bidirectional_scroll_view 0.0.5 archive
0.0.4 Jul 29, 2017 Go to the documentation of bidirectional_scroll_view 0.0.4 Download bidirectional_scroll_view 0.0.4 archive
0.0.3 Jul 29, 2017 Go to the documentation of bidirectional_scroll_view 0.0.3 Download bidirectional_scroll_view 0.0.3 archive
0.0.2 Jul 24, 2017 Go to the documentation of bidirectional_scroll_view 0.0.2 Download bidirectional_scroll_view 0.0.2 archive
0.0.1 Jul 24, 2017 Go to the documentation of bidirectional_scroll_view 0.0.1 Download bidirectional_scroll_view 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
77
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs (-9.29 points)

13 out of 14 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

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

Analysis of lib/bidirectional_scroll_view.dart reported 1 hint:

line 4 col 7: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final).

Maintenance issues and suggestions

Support latest stable Dart SDK in pubspec.yaml. (-20 points)

The SDK constraint in pubspec.yaml doesn't allow the latest stable Dart SDK release.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

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