A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

Overview

Draggable Home

A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier! Based on the Scaffold and Sliver.


Example Example Example


Usage

Make sure to check out examples for more details.

Installation

Add the following line to pubspec.yaml:

dependencies:
  draggable_home: ^1.0.2

Basic setup

The complete example is available here.

DraggableHome requires you to provide title, headerWidget and body:

  • title widget is basically for a title in the AppBar. For no title in AppBar, simply pass an empty Container.
  • headerWidget is the expanded widget just above the body when not fully expanded.
  • body is in the form of Column which requires a list of widget or a widget. Do not add any vertically scrollable widget or you may just disable the scroll.
  physics: const NeverScrollableScrollPhysics()

Sample code

DraggableHome(
  title: Text("Title"),
  headerWidget: headerWidget(),
  body: [
    Container(...),
    (...),
  ]
);

Arguments

There are several options that allow for more control:

Properties Description
leading A widget to display before the toolbar's title.
action A list of Widgets to display in a row after the title widget.
drawer Drawers are typically used with the Scaffold.drawer property.
centerTitle Allows toggling of title from the center. By default, title is in the center.
headerExpandedHeight Height of the header widget. The height is a double between 0.0 and 1.0. The default value of height is 0.35 and should be less than stretchMaxHeight
headerWidget A widget to display Header above the body.
alwaysShowLeadingAndAction This makes Leading and Action always visible. Default value is false.
headerBottomBar AppBar or toolBar like widget just above the body.
backgroundColor The color of the Material widget that underlies the entire DraggableHome body.
curvedBodyRadius Creates a border top-left and top-right radius of body, Default radius of the body is 20.0. For no radius simply set the value to 0.
fullyStretchable Allows toggling of fully expand draggability of the DraggableHome. Set this to true to allow the user to fully expand the header.
stretchTriggerOffset The offset of overscroll required to fully expand the header.
expandedBody A widget to display when fully expanded as header or expandedBody above the body.
stretchMaxHeight Height of the expandedBody widget. The height is a double between 0.0 and 0.95. The default value of height is 0.9 and should be greater than headerExpandedHeight
bottomSheet A persistent bottom sheet shows information that supplements the primary content of the app. A persistent bottom sheet remains visible even when the user interacts with other parts of the app.
bottomNavigationBarHeight This is required when using custom height to adjust body height. This makes no effect on bottomNavigationBar.
bottomNavigationBar Snack bars slide from underneath the bottom navigation bar while bottom sheets are stacked on top.
floatingActionButton A floating action button is a circular icon button that hovers over content to promote a primary action in the application.
floatingActionButtonLocation An object that defines a position for the FloatingActionButton based on the Scaffold's ScaffoldPrelayoutGeometry.
floatingActionButtonAnimator Provider of animations to move the FloatingActionButton between FloatingActionButtonLocations.


Sample code for ListView.builder

Card( child: ListTile( title: Text("$index"), ), ), ), (...), ] ); ">
DraggableHome(
  title: Text("Title"),
  headerWidget: headerWidget(),
  body: [
    Container(...),

    // shrinkWrap true required for ListView.builder()
    // disable the scroll for any vertically scrollable widget
    // provide top padding 0 to fix extra space in listView
    ListView.builder(
      padding: EdgeInsets.only(top: 0),
      physics: NeverScrollableScrollPhysics(),
      shrinkWrap: true,
      itemCount: list.length,
      itemBuilder: (context, index) => Card(
        child: ListTile(
          title: Text("$index"),
        ),
      ),
    ),

    (...),
  ]
);


Example Example Example


Show some โค๏ธ and โญ the repo

GitHub followers GitHub followers

Contributions

Contributions are welcome!

If you feel that a hook is missing, feel free to open a Pull Request.

For a custom hook to be merged, you will need to do the following:

  • Describe the use case.

  • Open an issue explaining why we need this hook, how to use it, ... This is important as a hook will not get merged if the hook doesn't appeal to a large number of people.

  • If your hook is rejected, don't worry! A rejection doesn't mean that it won't be merged later in the future if more people show an interest in it. In the meantime, feel free to publish your hook as a package on https://pub.dev.

  • A hook will not be merged unless fully tested, to avoid breaking it inadvertently in the future.

Comments
  • Add alwaysShowTitle property

    Add alwaysShowTitle property

    Status

    READY

    Breaking Changes

    NO

    Description

    Add alwaysShowTitle property

    Type of Change

    • [x] โœจ New feature (non-breaking change which adds functionality)
    • [x] ๐Ÿ“ Documentation
    opened by Drakonov 8
  • enhancement: `ScrollPhysics` can be modified

    enhancement: `ScrollPhysics` can be modified

    Status

    READY

    Breaking Changes

    Yes

    Description

    I am very happy to find this package. It helps me to make very nice UI for my app, but there is one problem that I am facing is:

    • When body is a List<Widget> but element in that just a SizedBox or for example I want to show my blogs in there, if haven't any blogs, i want to lock the scroll and UI still scrolls the body, it is very terrible for me because nothing in there or had so many white space, this attachment is demo video: Screencast from 10-10-2022 18:12:42.webm

    My solution is: add physics to modify the ScrollPhysics to implement some cases of UI when developers need (by default still is BouncingScrollPhysics)

    Type of Change

    • [X] โœจ New feature (non-breaking change which adds functionality)
    • [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue)
    • [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] ๐Ÿงน Code refactor
    • [ ] โœ… Build configuration change
    • [ ] ๐Ÿ“ Documentation
    • [ ] ๐Ÿ—‘๏ธ Chore
    opened by dungngminh 0
  • enhancement: `ScrollPhysics` can be modified

    enhancement: `ScrollPhysics` can be modified

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    ScrollPhysics can be modified

    Description

    I am very happy to find this package. It helps me to make very nice UI for my app, but there is one problem that I am facing is:

    • When body is a List<Widget> but element in that just a SizedBox or for example I want to show my blogs in there, if haven't any blogs, i want to lock the scroll and UI still scrolls the body, it is very terrible for me because nothing in there or had so many white space, this attachment is demo video: Screencast from 10-10-2022 18:12:42.webm

    My solution is: add physics to modify the ScrollPhysics to implement some cases of UI when developers need

    Type of Change

    • [X] โœจ New feature (non-breaking change which adds functionality)
    • [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue)
    • [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] ๐Ÿงน Code refactor
    • [ ] โœ… Build configuration change
    • [ ] ๐Ÿ“ Documentation
    • [ ] ๐Ÿ—‘๏ธ Chore
    opened by dungngminh 0
  • Code & performance improvements

    Code & performance improvements

    Status

    READY

    Breaking Changes

    NO

    Description

    Code and performance improvements. Separated into individual commits.

    Type of Change

    • [ ] โœจ New feature (non-breaking change which adds functionality)
    • [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue)
    • [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] ๐Ÿงน Code refactor
    • [ ] โœ… Build configuration change
    • [ ] ๐Ÿ“ Documentation
    • [ ] ๐Ÿ—‘๏ธ Chore
    opened by michalsrutek 0
  • Update documentation

    Update documentation

    Status

    READY

    Breaking Changes

    NO

    Description

    Fix grammar & typos in README.md and CHANGELOG.md

    Type of Change

    • [ ] โœจ New feature (non-breaking change which adds functionality)
    • [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue)
    • [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] ๐Ÿงน Code refactor
    • [ ] โœ… Build configuration change
    • [x] ๐Ÿ“ Documentation
    • [ ] ๐Ÿ—‘๏ธ Chore
    opened by ghpranav 0
  • Loading more....

    Loading more....

    Hello,

    Is it possible to implement a "Loading more" with your package ? If we scroll at the end of the body, the app can load more items ...

    Thanks

    opened by vptcnt 2
Releases(v1.0.3)
Sliding card is a highly customizable flutter package that will help you create beautiful Cards with a sliding animation effect.

Sliding Card Introduction Sliding card is a highly customizable flutter package that will help you create beautiful Cards with a sliding animation eff

null 21 Nov 4, 2022
A sliding up panel widget which can be used to show or hide content, beautiful and simple.

flutter_sliding_up_panel A sliding up panel widget which can be used to show or hide content, beautiful and simple. demo Getting Started dependencies:

null 25 Dec 12, 2022
A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

flutter_floatwing A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter. Android only Features Pure Flu

Zoe 116 Dec 21, 2022
Flutter widgets and themes implementing the current macOS design language.

macos_ui Flutter widgets and themes implementing the current macOS design language. NOTE: This package depends on the excellent native_context_menu pl

Reuben Turner 1.1k Jan 7, 2023
A collapsible sidebar for Flutter apps implementing the Material Design.

collapsible_sidebar A collapsible sidebar for Flutter apps implementing the Material Design. Features Material Design Pre-built customizable tile widg

Arjun Sinha 121 Nov 30, 2022
Flutter reaction button plugin it is fully customizable widget such as Facebook reaction button

Flutter Reaction Button Flutter button reaction it is fully customizable widget such as Facebook reaction button. Preview Demo Usage Include 'flutter_

Abdelouahed Medjoudja 174 Dec 19, 2022
An advanced switch widget, that can be fully customized with size, text, color, radius of corners.

flutter_advanced_switch An advanced switch widget, that can be fully customized with size, text, color, radius of corners. Switch Light Switch Dark Ge

Alex Melnyk 13 Dec 15, 2022
Flutter Package for Easier Creation of Home Screen Widgets

Home Widget HomeWidget is a Plugin to make it easier to create HomeScreen Widgets on Android and iOS. HomeWidget does not allow writing Widgets with F

Anton Borries 405 Dec 31, 2022
A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

Christoph Krassnigg 9 Dec 9, 2022
A flutter carousel widget, support infinite scroll, and custom child widget.

carousel_slider A carousel slider widget. Features Infinite scroll Custom child widgets Auto play Supported platforms Flutter Android Flutter iOS Flut

Bart T 1 Nov 25, 2021
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
A simple Flutter widget to add in the widget tree when you want to show nothing, with minimal impact on performance.

nil A simple widget to add in the widget tree when you want to show nothing, with minimal impact on performance. Why? Sometimes, according to a condit

Romain Rastel 127 Dec 22, 2022
A Flutter Widget to make interactive timeline widget.

Bubble Timeline Package A Flutter Widget to make interactive timeline widget. This widget can be used to make Event Timelines, or Timelines for certai

Vansh Goel 12 Sep 22, 2022
๐Ÿ“ธ Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget.

?? Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.

Blue Fire 1.7k Jan 7, 2023
A widget lib that the widget in this lib can react to flutter ScrollController's offset

Language: English | ไธญๆ–‡็ฎ€ไฝ“ linked_scroll_widgets A lib full of widgets that can react to the scrollController's offset change,to custom your UI effect.

WenJingRui 8 Oct 16, 2022
Full customable rolling switch widget for flutter apps based on Pedro Massango's 'crazy-switch' widget

lite_rolling_switch Full customable rolling switch widget for flutter apps based on Pedro Massango's 'crazy-switch' widget https://github.com/pedromas

Eduardo Muรฑoz 48 Dec 1, 2022
A Flutter widget that will give a Glitch Animation Effect to it's child widget.

GlitchEffect A Flutter widget that will give a Glitch Animation Effect to it's child widget. Installation Add the latest version of package to your pu

Sameer Singh 6 Nov 25, 2022
Widget, that can make any static located widget hidable

Installing See the official installing guidline from hidable/install Usage & Overview To start using Hidable widget, we have to create a ScrollControl

Anon 18 Dec 16, 2022
A widget that allow user resize the widget with drag

Flutter-Resizable-Widget A widget that allow user resize the widget with drag Note: this widget uses Getx Example bandicam.2021-11-11.12-34-41-056.mp4

MohammadAminZamani.afshar 22 Dec 13, 2022