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

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)
Fully Featured Chat App Using Firebase, RiverPod and much more.

LetsChat Fully Featured Chat App Using Firebase, RiverPod and much more. LetsChat app has a beautiful responsive UI. The app includes many features li

Mateen Mehmood 94 Dec 6, 2022
A flutter package which will help you to create a draggable widget that can be dragged around the screen.

A flutter package which will help you to create a draggable widget that can be dragged around the screen. Demo Features ?? Manually Control the positi

Adar 31 Aug 10, 2022
This package helps developer to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with teams

Package helps to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with

DANCHE 7 Dec 21, 2022
Nebula makes your Flutter development journey easier by providing helper widgets, utilities and abstractions.

Nebula makes your Flutter development journey easier by providing helper widgets, utilities and abstractions.

Aldrin's Art Factory 1 Apr 21, 2022
πŸ’™πŸ”₯ FlutterFire commons repository, makes FlutterFire app development faster, easier, and more fun!

???? FlutterFire commons repository, makes FlutterFire app development faster, easier, and more fun!

Kosuke Saigusa 18 Dec 1, 2022
Response Parser makes it easier to parse data and error response from server.

Response Parser makes it easier to parse data and error response from server. Getting started Do you want to write this pretty functions... Future<Eit

Qyre AB 4 Nov 5, 2022
A Flutter widget for images sliding

Simple Image Slider Widget (https://pub.dartlang.org/packages/simple_slider) A flutter library to show images in a sliding widget, the library also pr

Eddy WM 53 Jul 20, 2022
A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for rent

iEnergy App A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for ren

AndrΓ© Diogo 1 Jun 7, 2022
Show a draggable floating chat icon button and show messages on screens

Show a draggable floating chat icon button and show messages on screens Features A widget for displaying a chat icon (or custom widget) on top of a ba

CU Apps 4 May 5, 2022
Draggable Scrollbar - A scrollbar that can be dragged for quickly navigation through a vertical list.

A scrollbar that can be dragged for quickly navigation through a vertical list. Additionaly it can show label next to scrollthumb with information about current item, for example date of picture created

Flutter Community 425 Dec 10, 2022
A customizable carousel slider for Flutter. Supports infinite sliding, custom indicators, and custom animations with many pre-built indicators and animations.

Flutter Carousel Slider A customizable carousel slider for flutter Screenshots Installing dependencies: flutter_carousel_slider: ^1.0.8 Demo Demo a

Udara Wanasinghe 23 Nov 6, 2022
Bottom navigation bar with sliding clip effect.

Sliding Clipped Nav Bar Design Credit Toolbar icons animation by Cuberto How to use? API reference barItems β†’ List<BarItem> List of bar items that sho

Watery Desert 55 Dec 3, 2022
Flutter Youtube Redesign. this gave me so much Experience For Flutter . I used Video_player and Spring animation packages in this project

youtube A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

null 1 Dec 13, 2021
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022
Flutter form fields designed to take much of the burden of form-related coding off the programmer's back β€” masks, validations, keyboard type, etc.

well_formed Contents Overview Getting Started Demo application References Overview Well-Formed Widget Fields - Well-Formed - is a collection of Flutte

Dartoos 7 Nov 2, 2022
Readky is a Free Flutter News App Starter Template that can help you develop a News application much faster.

Readky. Introduction Readky is a Free Flutter News App Starter Template that can help you develop a News application much faster. You just need to add

Muhammad Rezky Sulihin 54 Nov 26, 2022
Hungry is a Free Flutter Recipe App Starter Template that can help you develop a Recipe application much faster.

Hungry is a Free Flutter Recipe App Starter Template that can help you develop a Recipe application much faster. You just need to add some adjustment to the frontend and you can create your own backend.

Muhammad Rezky Sulihin 48 Dec 20, 2022
Another breakpoint framework. Aims to simplify as much as possible building adaptive layouts.

Another breakpoint framework. Aims to simplify as much as possible building adaptive layouts. Features Really simple implementation Works with and wit

null 3 Sep 26, 2022