Giter VIP home page Giter VIP logo

zakanun / flutter_draggable_gridview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mindinventory/flutter_draggable_gridview

0.0 0.0 0.0 14.34 MB

This package supports drag & drop widgets inside the GridView.builder for multiplatform. It provides all the properties which are available in Gridview. builder and easy to implement with the few lines of code.

Home Page: https://www.mindinventory.com/flutter-app-development.php

License: MIT License

Objective-C 0.11% Kotlin 0.34% Dart 84.45% Swift 3.20% HTML 4.15% Ruby 7.75%

flutter_draggable_gridview's Introduction

flutter_draggable_gridview

flutter_draggable_gridview version flutter_draggable_gridview Git Stars MIT License

This package supports drag & drop widgets inside the GridView.builder for multiplatform. It provides all the properties which are available in Gridview.builder and easy to implement with the few lines of code.

Draggable GridView.

Draggable GridView

Usage

Example

      DraggableGridViewBuilder(
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
          childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 3),
        ),
        children: _listOfDraggableGridItem,
        isOnlyLongPress: false,
        dragCompletion: (List<DraggableGridItem> list, int beforeIndex, int afterIndex) {
          print( 'onDragAccept: $beforeIndex -> $afterIndex');
        },
        dragFeedback: (List<DraggableGridItem> list, int index) {
          return Container(
            child: list[index].child,
            width: 200,
            height: 150,
          );
        },
        dragPlaceHolder: (List<DraggableGridItem> list, int index) {
          return PlaceHolderWidget(
            child: Container(
              color: Colors.white,
            ),
          );
        },
      );

Required parameters

gridDelegate:

A delegate that controls the layout of the children within the GridView.

children:

This property contains list of [DraggableGridItem] and it is use to show the widget inside the GridView.builder to provide the drag & drop functionality. Also, it contains isDraggable parameter which manages enable/disable the drag & drop functionality.

dragCompletion:

This callback provides updated list and old and new indexes.

Optional parameters

isOnlyLongPress:

This property contains bool value. If this property is false then it works with simple press draggable or else it works with long press. default value is 'true'.

dragFeedback:

With this callback, you have to return a Widget and we will use this widget in feedback. Learn more about feedback from Draggable class.

dragPlaceHolder:

TWith this callback, you have to return a PlaceHolderWidget and we will use this widget in place holder.

dragChildWhenDragging:

With this callback, you have to return a Widget and we will display this widget instead of child when drags are under way. Learn more about childWhenDragging from Draggable class.

Last But Not Least ๐Ÿ˜

You can use all the GridView.builder properties with DraggableGridViewBuilder class.

Note:

The result returns in List. so it can be lost later, you are responsible for storing it somewhere permanent (if needed).

Guideline for contributors

Contribution towards our repository is always welcome, we request contributors to create a pull request to the develop branch only.

Guideline to report an issue/feature request

It would be great for us if the reporter can share the below things to understand the root cause of the issue.

  • Library version
  • Code snippet
  • Logs if applicable
  • Device specification like (Manufacturer, OS version, etc)
  • Screenshot/video with steps to reproduce the issue

LICENSE!

Flutter Draggable GridView is MIT-licensed.

Let us know!

Weโ€™d be really happy if you send us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding our work.

flutter_draggable_gridview's People

Contributors

sahilmind avatar abrarmalekji345 avatar pratikkansaramind avatar hetpra9653 avatar deep-mindinventory avatar mi-ghanshyam avatar matheusrmelo avatar mohit-chauhan-mi avatar mi-raj04 avatar ryuujo1573 avatar zakanun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.