slide_container 1.0.2

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

Slide Container #

A container that can be slid vertically and horizontally with a smooth dampened motion.

Build the example folder with flutter run for a demo, or check the video in this blog post:

https://tengio.com/blog/flutter-slide-container/

Install instructions and doc are available here:

https://pub.dartlang.org/packages/slide_container

1.0.2 - 2018-10-09 #

  • Updated README.

1.0.1 - 2018-10-06 #

  • Added support for horizontal sliding.
  • Breaking change
    • Renamed class VerticalSlideContainer to SlideContainer
    • Renamed enum VerticalSlideContainerDirection to SlideContainerDirection and changed its values.

1.0.0 - 2018-10-05 #

  • Initial release.

example/lib/main.dart

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

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          body: _Body(),
        ),
      );
}

class _Body extends StatefulWidget {
  @override
  _State createState() => _State();
}

class _State extends State<_Body> {
  double position = 0.0;

  double get maxSlideDistance => MediaQuery.of(context).size.height * 0.4;

  void onSlide(double position) {
    setState(() => this.position = position);
  }

  @override
  Widget build(BuildContext context) => new Stack(
        children: <Widget>[
          Positioned(
            top: MediaQuery.of(context).size.height * 0.20,
            width: MediaQuery.of(context).size.width,
            child: Text(
              "❤️",
              style: TextStyle(fontSize: 46.0),
              textAlign: TextAlign.center,
            ),
          ),
          Positioned(
            bottom: MediaQuery.of(context).size.height * 0.20,
            width: MediaQuery.of(context).size.width,
            child: Text(
              "✌️",
              style: TextStyle(fontSize: 46.0),
              textAlign: TextAlign.center,
            ),
          ),
          SlideContainer(
            slideDirection: SlideContainerDirection.vertical,
            onSlide: onSlide,
            maxSlideDistance: maxSlideDistance,
            child: Container(
              width: MediaQuery.of(context).size.width,
              height: MediaQuery.of(context).size.height,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color.lerp(Color(0xfffddb92), Color(0xfffed6e3), position),
                    Color.lerp(Color(0xffd1fdff), Color(0xff9a9ce2), position),
                  ],
                ),
                boxShadow: [
                  BoxShadow(
                    color: Color(0x90000000),
                    blurRadius: 15.0,
                    spreadRadius: 10.0,
                  ),
                ],
              ),
              child: Center(
                child: Text(
                  "Slide me!",
                  style: TextStyle(fontSize: 26.0),
                ),
              ),
            ),
          ),
        ],
      );
}

Use this package as a library

1. Depend on it

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


dependencies:
  slide_container: ^1.0.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:slide_container/slide_container.dart';
  
Version Uploaded Documentation Archive
1.0.7 Nov 29, 2018 Go to the documentation of slide_container 1.0.7 Download slide_container 1.0.7 archive
1.0.6 Oct 25, 2018 Go to the documentation of slide_container 1.0.6 Download slide_container 1.0.6 archive
1.0.5 Oct 25, 2018 Go to the documentation of slide_container 1.0.5 Download slide_container 1.0.5 archive
1.0.4 Oct 25, 2018 Go to the documentation of slide_container 1.0.4 Download slide_container 1.0.4 archive
1.0.3 Oct 10, 2018 Go to the documentation of slide_container 1.0.3 Download slide_container 1.0.3 archive
1.0.2 Oct 9, 2018 Go to the documentation of slide_container 1.0.2 Download slide_container 1.0.2 archive
1.0.1 Oct 6, 2018 Go to the documentation of slide_container 1.0.1 Download slide_container 1.0.1 archive
1.0.0 Oct 6, 2018 Go to the documentation of slide_container 1.0.0 Download slide_container 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
78
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]
89
Learn more about scoring.

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

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
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