├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android └── app │ └── src │ └── main │ └── java │ └── io │ └── flutter │ └── plugins │ └── GeneratedPluginRegistrant.java ├── example ├── .gitignore ├── .idea │ ├── codeStyles │ │ └── Project.xml │ ├── libraries │ │ ├── Dart_Packages.xml │ │ ├── Dart_SDK.xml │ │ ├── Flutter_Plugins.xml │ │ └── Flutter_for_Android.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations │ │ └── main_dart.xml │ └── workspace.xml ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tengio │ │ │ │ └── slidecontainerexample │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ ├── help_page.dart │ ├── main.dart │ ├── page1.dart │ ├── page2.dart │ └── page3.dart ├── pubspec.lock ├── pubspec.yaml ├── slide_container_example.iml └── slide_container_example_android.iml ├── lib ├── extended_drag_gesture_recognizer.dart ├── slide_container.dart └── slide_container_controller.dart ├── pubspec.lock ├── pubspec.yaml └── slide_container.iml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | **/.DS_Store 3 | .idea/ 4 | .vscode/ 5 | **/.idea/ 6 | .metadata 7 | .packages 8 | .flutter-plugins 9 | build/ 10 | 11 | #android related 12 | **/android/local.properties 13 | **/android/**/GeneratedPluginRegistrant.java 14 | 15 | # iOS/XCode related 16 | **/ios/**/*.mode1v3 17 | **/ios/**/*.mode2v3 18 | **/ios/**/*.moved-aside 19 | **/ios/**/*.pbxuser 20 | **/ios/**/*.perspectivev3 21 | **/ios/**/*sync/ 22 | **/ios/**/.sconsign.dblite 23 | **/ios/**/.tags* 24 | **/ios/**/.vagrant/ 25 | **/ios/**/DerivedData/ 26 | **/ios/**/Icon? 27 | **/ios/**/Pods/ 28 | **/ios/**/profile 29 | **/ios/**/xcuserdata 30 | **/ios/.generated/ 31 | **/ios/Flutter/App.framework 32 | **/ios/Flutter/Flutter.framework 33 | **/ios/Flutter/Generated.xcconfig 34 | **/ios/Flutter/app.flx 35 | **/ios/Flutter/app.zip 36 | **/ios/Flutter/flutter_assets/ 37 | **/ios/ServiceDefinitions.json 38 | **/ios/Runner/GeneratedPluginRegistrant.* 39 | **/ios/Podfile.lock 40 | 41 | **/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/ 42 | 43 | android/Gemfile 44 | ios/Gemfile 45 | ios/Runner.app.dSYM.zip 46 | ios/Runner.ipa 47 | 48 | # Flutter auto generated: 49 | example/ios/Flutter/flutter_export_environment.sh 50 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.1.2 - 2019-10-09 2 | 3 | * Fixed container hit detection area not moving with content. 4 | * Updated example to demo the issue above and show a work around. 5 | * Updated example to add a few more use cases. 6 | 7 | ## 1.1.1 - 2019-10-09 8 | 9 | * Added option to disable auto-slide, allowing the container to stay where it as been dragged when the gesture end, instead of snapping to the start position or to the full extent. 10 | 11 | ## 1.1.0 - 2019-09-18 12 | 13 | * **Breaking change** Fixed naming issue with new Flutter version (1.9.0 and above). Use this version of the plugin when you upgrade Flutter. 14 | 15 | ## 1.0.7 - 2018-11-29 16 | 17 | * Added the SlideContainerController to allow a manual force slide in a given direction. 18 | * Updated example app to showcase the new SlideContainerController. 19 | 20 | ## 1.0.6 - 2018-10-25 21 | 22 | * Fixed Flutter analysis warnings. 23 | 24 | ## 1.0.5 - 2018-10-25 25 | 26 | * Fixed Flutter analysis warnings. 27 | 28 | ## 1.0.4 - 2018-10-25 29 | 30 | * Added onSlideValidated and onSlideUnvalidated callbacks. 31 | 32 | ## 1.0.3 - 2018-10-10 33 | 34 | * Improved logic to reduce nested GestureDetector conflicts. Now if the container as been slid to 35 | its max extent in one direction, trying to slid it more in this direction will not count as a gesture, 36 | thus allowing other GestureDetectors to get and handle the event. 37 | 38 | ## 1.0.2 - 2018-10-09 39 | 40 | * Updated README. 41 | 42 | ## 1.0.1 - 2018-10-06 43 | 44 | * Added support for horizontal sliding. 45 | * **Breaking change** 46 | * Renamed class `VerticalSlideContainer` to `SlideContainer` 47 | * Renamed enum `VerticalSlideContainerDirection` to `SlideContainerDirection` and changed its values. 48 | 49 | ## 1.0.0 - 2018-10-05 50 | 51 | * Initial release. 52 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Created by Quentin Le Guennec and Tengio Ltd 2 | https://tengio.com/ 3 | 4 | Copyright 2018 Tengio Ltd 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | * Neither the name of Tengio Ltd nor the names of its contributors may 16 | be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL TENGIO LTD OR THE CONTRIBUTORS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Awesome Flutter 3 | 4 | 5 | 6 | Dart Pub 7 | 8 | 9 | # Slide Container 10 | 11 | A container that can be slid vertically and horizontally with a smooth dampened motion. 12 | 13 | Offers a handful of callbacks for customization and handles both drag distance and velocity to validate swipe gestures. 14 | 15 | Features a customized GestureDetector to reduce nested GestureDetector conflicts. 16 | 17 | Build the `example` folder with `flutter run` for a demo, or check the video in this blog post: 18 | 19 | https://tengio.com/blog/flutter-slide-container/ 20 | 21 | Install instructions and doc are available here: 22 | 23 | https://pub.dartlang.org/packages/slide_container 24 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | 5 | /** 6 | * Generated file. Do not edit. 7 | */ 8 | public final class GeneratedPluginRegistrant { 9 | public static void registerWith(PluginRegistry registry) { 10 | if (alreadyRegisteredWith(registry)) { 11 | return; 12 | } 13 | } 14 | 15 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 16 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 17 | if (registry.hasPlugin(key)) { 18 | return true; 19 | } 20 | registry.registrarFor(key); 21 | return false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /example/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /example/.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /example/.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | -------------------------------------------------------------------------------- /example/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /example/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |