Giter Site home page Giter Site logo

josiahsrc / dough Goto Github PK

View Code? Open in Web Editor NEW
683.0 7.0 27.0 8.53 MB

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

License: MIT License

Dart 75.31% Kotlin 0.27% Swift 0.88% Objective-C 0.08% HTML 3.27% Ruby 2.96% SCSS 0.24% TypeScript 16.97%
flutter dart flutter-ui flutter-widget flutter-package ui ux rubberband drag squishy-widgets

dough's Introduction

Hi there ๐Ÿ‘‹

I'm a graduate from the computer science department at Brigham Young University, UT ๐ŸŒ†

  • ๐Ÿ”ญ Iโ€™m currently working on personal projects
  • ๐ŸŒฑ I'm learning how to how to penny board down big hills
  • ๐Ÿง‘โ€๐Ÿ’ป Iโ€™m looking to collaborate on open source projects
  • ๐Ÿ’ฌ Ask me about Flutter and Dart

Open Source Projects

Dough

Flutter Zustand

VSCode Bazel

dough's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dough's Issues

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.

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:

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.

Migrate to null safety

Dart team recommends that packages migrate to null-safety. Create/test a null safety API for dough.

'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

[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?

flutter 3.0.0

Describe the bug
Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

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

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.