This package provides some widgets you can use to create a smooshy UI.

Overview

Flutter Dough

Dough Library

Squishy widgets for Flutter.

Quick Links

Demos

Here are a few samples of the different widgets provided by this repo. You can find more information on how to use these widgets in the main Dough project.

Pressable Dough

PressableDough Demo

Draggable Dough

DraggableDough Demo

Gyro Dough

GyroDough Demo

Custom Dough

CustomDough Demo

Comments
  • [suggestion] Dough 3D rotation

    [suggestion] Dough 3D rotation

    I was messing around to achieve the realistic scaling mentioned in the README

    drag_dough In DraggableOverlayDoughTransformer.createDoughMatrix() I made this change:

    @override
      Matrix4 createDoughMatrix() {
        final adhesiveDx = delta.x * t / recipe.adhesion;
        final adhesiveDy = delta.y * t / recipe.adhesion;
    
        Matrix4 translate;
        if (applyDelta) {
          if (snapToTargetOnStop) {
            final dx = -delta.x * (controller.isActive ? 1 : t);
            final dy = -delta.y * (controller.isActive ? 1 : t);
            translate = Matrix4.translationValues(
                  dx + adhesiveDx,
                  dy + adhesiveDy,
                  0,
                )
            //--- Rotate in 3 dimensions ---------------
                * (Matrix4.identity()
                  ..setEntry(3, 2, 0.01)
                  ..rotateY(-(dx + adhesiveDx) * 0.01)
                  ..rotateX((dy + adhesiveDy) * 0.01));
            //-------------------------------------------
          } else {
            translate = Matrix4.translationValues(
              -delta.x + adhesiveDx,
              -delta.y + adhesiveDy,
              0,
            );
          }
        } else {
          translate = Matrix4.translationValues(adhesiveDx, adhesiveDy, 0);
        }
    
        return translate * bendWithDeltaMatrix() * expansionMatrix();
      }
    

    Is that what you are looking for?

    opened by Schwusch 5
  • 'package:flutter/src/widgets/framework.dart': Failed assertion: line 4138 pos 12: '_debugLifecycleState != _ElementLifecycle.defunct': is not true.

    'package:flutter/src/widgets/framework.dart': Failed assertion: line 4138 pos 12: '_debugLifecycleState != _ElementLifecycle.defunct': is not true.

    Hello. Am getting the above error when I pop the containing page. Am I doing something wrong?

    Love the package otherwise, thanks!

    ════════ Exception caught by widgets library ═══════════════════════════════════ The following assertion was thrown while finalizing the widget tree: _DoughState#6945b(ticker active) was disposed with an active Ticker.

    _DoughState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling super.dispose().

    Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.

    The offending ticker was: Ticker(created by _DoughState#6945b(lifecycle state: created)) The stack trace when the Ticker was actually created was:

    #0 new Ticker. package:flutter/…/scheduler/ticker.dart:66 #1 new Ticker package:flutter/…/scheduler/ticker.dart:68 #2 SingleTickerProviderStateMixin.createTicker package:flutter/…/widgets/ticker_provider.dart:129 #3 new AnimationController package:flutter/…/animation/animation_controller.dart:247 #4 _DoughState.initState package:dough/dough.dart:47 #5 StatefulElement._firstBuild package:flutter/…/widgets/framework.dart:4640 #6 ComponentElement.mount package:flutter/…/widgets/framework.dart:4476 ... Normal element mounting (15 frames) #21 Element.inflateWidget package:flutter/…/widgets/framework.dart:3446 #22 MultiChildRenderObjectElement.mount package:flutter/…/widgets/framework.dart:5947 #23 Element.inflateWidget package:flutter/…/widgets/framework.dart:3446 #24 Element.updateChild package:flutter/…/widgets/framework.dart:3211 #25 ComponentElement.performRebuild package:flutter/…/widgets/framework.dart:4527 #26 StatefulElement.performRebuild package:flutter/…/widgets/framework.dart:4675 #27 Element.rebuild package:flutter/…/widgets/framework.dart:4218 #28 BuildOwner.buildScope package:flutter/…/widgets/framework.dart:2627 #29 WidgetsBinding.drawFrame package:flutter/…/widgets/binding.dart:883 #30 RendererBinding._handlePersistentFrameCallback package:flutter/…/rendering/binding.dart:284 #31 SchedulerBinding._invokeFrameCallback package:flutter/…/scheduler/binding.dart:1113 #32 SchedulerBinding.handleDrawFrame package:flutter/…/scheduler/binding.dart:1052 #33 SchedulerBinding._handleDrawFrame package:flutter/…/scheduler/binding.dart:968 #37 _invoke (dart:ui/hooks.dart:261:10) #38 _drawFrame (dart:ui/hooks.dart:219:3) (elided 3 frames from dart:async)

    When the exception was thrown, this was the stack #0 SingleTickerProviderStateMixin.dispose. package:flutter/…/widgets/ticker_provider.dart:142 #1 SingleTickerProviderStateMixin.dispose package:flutter/…/widgets/ticker_provider.dart:156 #2 _DoughState.dispose package:dough/dough.dart:60 #3 StatefulElement.unmount package:flutter/…/widgets/framework.dart:4729 #4 _InactiveElements._unmount package:flutter/…/widgets/framework.dart:1922

    opened by leidig54 4
  • Long press Draggable Dough

    Long press Draggable Dough

    Long press Draggable, to have more control to move Dough Items inside List View

    Describe the solution you'd like https://api.flutter.dev/flutter/widgets/LongPressDraggable-class.html

    enhancement 
    opened by thize 1
  • Squash Widget for Dough Expansion-Like effects

    Squash Widget for Dough Expansion-Like effects

    I have tried to do something similar to Squash effect or Jelly-like-click, using ScaleTransition and used controller.fling() to keep the current state until it is pressed.

    opened by amitverma-cf 1
  • Gyro Dough

    Gyro Dough

    A widget that morphs based on how a user moves their mobile device around in physical space (using gyro sensors). If a user shakes their phone to the left (or maybe tilts it to the left), a widget wrapped in the GyroDough widget will droop left, as if it were a real piece of dough.

    enhancement 
    opened by josiahsrc 0
  • Use the Provider package instead of Inherited widget

    Use the Provider package instead of Inherited widget

    This applies to the DoughRecipe class. It'd be nice if Provider was used instead of InheritedWidget.

    Use this to update the rolling sum of the gyro widget and other related functionality.

    enhancement Chore 
    opened by josiahsrc 0
  • Use the equatable package instead of raw equals implementation

    Use the equatable package instead of raw equals implementation

    Some classes (such as DoughRecipe and some of its fields) override equality checking manually using the == operator and hashcode() override. This is prone to error as more fields are added. Replace this equality checking implementation with the equatable package equality checking implementation.

    enhancement Chore 
    opened by josiahsrc 0
  • Multi-touch support - Pinchable or SqueezableDough()

    Multi-touch support - Pinchable or SqueezableDough()

    Multi-touch

    This would let you pinch and squeeze the dough from two or more sides, and the dough would droop down out or pile up, away from the forces applied to it, just like real dough. Currently, attempting to pinch the dough or use multi-touch make the dough warp across the screen.

    opened by mips171 1
  • Sensors introduces platform dependency

    Sensors introduces platform dependency

    Sensors introduces platform dependency for android and iOS and does not include the mac/linux/windows platform. This is causing the package to lose pub points.

    Find a way to support accelerometer functionality on mobile platforms (for GyroDough) while maintaining support for web/desktop platforms.

    https://pub.dev/packages/dough/score

    Chore 
    opened by josiahsrc 1
  • Reorderable List Dough

    Reorderable List Dough

    The draggable dough widget feels awesome. The same concept could be applied to a ReorderableList.

    A possible implementation would be:

    • The user presses on a reorderable list item.
    • The user drags the list item in a direction. Similar to DraggableDough, the list item will appear to stick to its slot. Once a drag threshold is met, the list item will elastically snap to the user's finger and will be freely movable/reorderable.

    Similar to this feature, except for reorderable lists instead:

    enhancement 
    opened by josiahsrc 0
Owner
Josiah Saunders
I build software.
Josiah Saunders
This Flutter plugin provides some widgets with gesture handlers.

Clickable Widget This Flutter plugin provides some flutter widgets having gesture handlers their don't natively have in Flutter. By default some flutt

Gael Vinou 7 Nov 17, 2022
Mixins is a package for shortening the use of some widgets or properties.

Usage It's not a great package, just help us to code briefly, everyone can make their own easily. To use this plugin, add mixins as a dependency in yo

Ashta 5 Nov 8, 2022
A composable, light-weight package that can be used as a placeholder whenever you need some fake data

API Placeholder A composable, light-weight package that can be used as a placeholder whenever you need some fake data. With this package, you can get

ASMIT VIMAL 2 Feb 27, 2022
An introduction slider has some screens that can use to describe your application.

An introduction slider has some screens that can use to describe your application. You can describe your application's title, description, logo, etc. It comes with several features.

Rahul Chouhan 6 Dec 7, 2022
This is a radio app where you can ask Alan AI to play some music.

AI-Powered Voice Assistant Flutter Radio App This is a radio app where you can ask Alan AI to play some music. Alan AI: https://voice.alan.app/MTechVi

Pawann Kumaarr 211 Jan 3, 2023
A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

easy_tab_controller A user-friendly TabBarController widget for flutter developer. Getting Started This project is a starting point for a Flutter plug

圆号本昊 3 May 26, 2022
Today we will show you how you can create your developer portfolio website and app using flutter.

Responsive and Animated Portfolio Website & App - Flutter UI Live Preview Watch it on YouTube Packages we are using: flutter_svg: link goole_fonts: li

Abu Anwar 198 Dec 30, 2022
Responsive-Ui-builder - The responsive ui builder package contains widgets that helps you to create your UI responsive

Responsive Ui Builder Getting Started The responsive ui builder package contains

null 0 Feb 1, 2022
Flutter package that provides you custom clippers to help you achieve various custom shapes.

flutter_custom_clippers Flutter package that provides you custom clippers to help you achieve various custom shapes. Usage To use this plugin, add flu

Damodar Lohani 291 Dec 23, 2022
This is a mason brick you can use to generate code that get's you started right up with a flutter project

flutter_brick This is a mason brick you can use to generate code that gets you started right up with a flutter project A flutter brick created with th

Bruce Omukoko 3 Sep 16, 2022
dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Md Abir Ahsan Tahmim 1 Dec 8, 2021
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
camilo velandia 69 Dec 30, 2022
A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

Ravi Kavaiya 89 Dec 8, 2022
A Flutter plugin that provides assets abstraction management APIs without UI integration, you can get assets (image/video/audio) on Android, iOS and macOS.

photo_manager Photo/Assets management APIs for Flutter without UI integration, you can get assets (image/video/audio) from Android, iOS and macOS. 提供相

FlutterCandies 526 Jan 4, 2023
Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

BetterX.io 4 Oct 2, 2022
This package adds CustomRefreshIndicator widget that allows you to create whatever indicator you want.

Custom Refresh Indicator A flutter package that allows you to easily create a custom refresh indicator widget. TLDR; ONLINE DEMO! QUICK START CustomRe

Kamil Klyta 315 Dec 16, 2022
A flutter app to practice some common and important widgets

Flutter Beginner 2 A flutter app to practice some common and important widgets Developer Alexander Sosa (https://www.linkedin.com/in/alexander-sosa-as

Alexander Sosa 0 Jan 3, 2022