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
With flutter tags you can create selectable or input tags that automatically adapt to the screen width

flutter_tags Create beautiful tags quickly and easily. Installing Add this to your package's pubspec.yaml file: dependencies: flutter_tags: "^0.4.9+

Antonino Di Natale 417 Dec 21, 2022
Flutter Widgets that you can touch and feel

Flutter widgets you haven't used yet. Problems that proximity solves Currently, Flutter has a lot of useful pre-built widgets, no, too many widgets. T

Masahiro Aoki 32 Nov 8, 2022
This Dart package offers developers a streamlined library of Flutter widgets, useful for expanding widgets and text views, when users interact with them.

This Dart package offers developers a streamlined library of Flutter widgets, useful for expanding widgets and text views, when users interact with them.

Jesús Rodríguez 44 Dec 6, 2022
A flutter package to display a country, states, and cities. In addition it gives the possibility to select a list of countries, States and Cities depends on Selected, also you can search country, state, and city all around the world.

A flutter package to display a country, states, and cities. In addition it gives the possibility to select a list of countries, States and Cities depends on Selected, also you can search country, state, and city all around the world.

Altaf Razzaque 25 Dec 20, 2022
A Flutter package that provides an Emoji picker widget with 1500+ emojis in 8 categories.

emoji_picker_flutter Yet another Emoji Picker for Flutter ?? Note: This package is based on emoji_picker which has been deprecated and not maintained

Stefan Humm 99 Dec 24, 2022
Some flutter best practice

مثال‌های پر استفاده فلاتر این ریپازیتوری شامل مثال‌هایی از استراتژی‌های مورد نیاز و پرتکرار در توسعه اپلیکیشن‌ها است. سعی شده است که در هر مثال به صور

Novin Tose'e Company 4 Sep 22, 2021
A vector tile renderer for use in creating map tile images or writing to a canvas. Written in Dart to enable use of vector tiles with Flutter.

vector_tile_renderer A vector tile renderer for use in creating map tile images or writing to a canvas. Written in Dart to enable use of vector tiles

David Green 30 Oct 7, 2022
Fluid layouts allows you to create responsive layout for mobile, web and desktop from a single codebase.

Fluid layout aims to help building a responsive experience through all the different screen sizes. Based in the boostrap approach, FluidLayout calculates a padding content (fluid_padding) that changes depending on the parent size. The Fluid widget uses that padding to set its size

Jaime Blasco 3 Jan 10, 2022
A TypeAhead widget for Flutter, where you can show suggestions to users as they type

Flutter TypeAhead A TypeAhead (autocomplete) widget for Flutter, where you can show suggestions to users as they type Features Shows suggestions in an

null 661 Jan 5, 2023
A Flutter package to easily create a Credit Card in your application.

Awesome Card A flutter package to create a Credit Card widget in your application. Stay tuned for the latest updates: ?? Screenshots ⚙️ Installation I

Vivek Kaushik 142 Dec 1, 2022
A Flutter package that enables users to resize the internal widgets by dragging.

resizable_widget ResizableWidget enables users to resize the internal widgets by dragging. This package contains simple APIs, but if needed, you can c

null 35 Dec 2, 2022
A powerful & easy to use timeline package for Flutter! 🚀

A powerful & easy to use timeline package for Flutter! ?? Caveat: This package is an early stage. Not enough testing has been done to guarantee stabil

Chulwoo Park 566 Dec 30, 2022
A flutter package to help you beautify your app popups.

flutter_beautiful_popup 中文 A flutter package to help you beautify your app popup, can be used in all platform.Live Demo. Preview: Getting Started Add

朱嘉伟 568 Dec 30, 2022
Create mobile game store design using Flutter

Create mobile game store design using Flutter

Firgia 16 Nov 25, 2022
Create mobile marketplace design using Flutter

On this Marketplace Design has two pages one for the product page which has a horizontal list of categories then a list of our products. Then on the details page, it shows the price, rating, total view, and description of the product with the Buy Now button.

Firgia 29 Nov 25, 2022
This a fluttet mobile application UI. that create for Virtual Reality Store.

Virtual Reality Store App Getting Started This a fluttet mobile application UI. that create for Virtual Reality Store. The app code is preloaded with

Sherange Fonseka 0 Nov 1, 2021
Project Flutter which discusses how to create a movie dashboard UI

MOvApps (Flutter Project) Hi everybody. How are you guys? May you always be in good health and of course always be blessed by God! I want to showcase

Aqshal Rizqullah 1 Nov 30, 2021
Responsive Sizer helps implement are responsive layout by providing helper widgets and extensions

Responsive Sizer Responsive Sizer helps implement a responsive layout by providing helper widgets and extensions Content Installation Parameters Take

CoderUni 71 Jan 3, 2023
A wrapper to show a scroll to top prompt to the user on scrollable widgets.

flutter_scroll_to_top A wrapper to show a scroll to top prompt to the user on scrollable widgets. Installing Add the following dependency to your pubs

Naman Shergill 11 May 16, 2022