├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── assets ├── gifs │ ├── custom-dough.gif │ ├── dough-recipe.gif │ ├── draggable-dough.gif │ ├── gyro-dough.gif │ └── pressable-dough.gif └── images │ ├── dough-logo@repo.png │ ├── dough-react-logo@repo.png │ ├── dough-sensors-logo@repo.png │ └── dough-web-logo@repo.jpeg ├── lerna.json ├── package-lock.json ├── package.json ├── packages ├── dough-js │ ├── .editorconfig │ ├── .gitignore │ ├── .prettierrc.json │ ├── LICENSE │ ├── package-lock.json │ ├── package.json │ ├── readme.md │ ├── src │ │ ├── components.d.ts │ │ ├── components │ │ │ ├── dough-all-purpose-flour │ │ │ │ ├── dough-all-purpose-flour.scss │ │ │ │ ├── dough-all-purpose-flour.tsx │ │ │ │ └── readme.md │ │ │ ├── dough-draggable │ │ │ │ ├── dough-draggable.scss │ │ │ │ ├── dough-draggable.tsx │ │ │ │ └── readme.md │ │ │ └── dough-pressable │ │ │ │ ├── dough-pressable.scss │ │ │ │ ├── dough-pressable.tsx │ │ │ │ └── readme.md │ │ ├── index.html │ │ ├── index.ts │ │ └── utils │ │ │ ├── math.spec.ts │ │ │ └── math.ts │ ├── stencil.config.ts │ └── tsconfig.json ├── dough-react │ ├── README.md │ ├── dist │ │ ├── components │ │ │ └── stencil-generated │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ └── react-component-lib │ │ │ │ ├── createComponent.js │ │ │ │ ├── createComponent.js.map │ │ │ │ ├── createOverlayComponent.js │ │ │ │ ├── createOverlayComponent.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── interfaces.js │ │ │ │ ├── interfaces.js.map │ │ │ │ └── utils │ │ │ │ ├── attachProps.js │ │ │ │ ├── attachProps.js.map │ │ │ │ ├── case.js │ │ │ │ ├── case.js.map │ │ │ │ ├── dev.js │ │ │ │ ├── dev.js.map │ │ │ │ ├── index.js │ │ │ │ └── index.js.map │ │ ├── index.js │ │ ├── index.js.map │ │ └── types │ │ │ ├── components │ │ │ └── stencil-generated │ │ │ │ ├── index.d.ts │ │ │ │ └── react-component-lib │ │ │ │ ├── createComponent.d.ts │ │ │ │ ├── createOverlayComponent.d.ts │ │ │ │ ├── index.d.ts │ │ │ │ ├── interfaces.d.ts │ │ │ │ └── utils │ │ │ │ ├── attachProps.d.ts │ │ │ │ ├── case.d.ts │ │ │ │ ├── dev.d.ts │ │ │ │ └── index.d.ts │ │ │ └── index.d.ts │ ├── lib │ │ ├── components │ │ │ └── stencil-generated │ │ │ │ ├── index.ts │ │ │ │ └── react-component-lib │ │ │ │ ├── createComponent.tsx │ │ │ │ ├── createOverlayComponent.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── interfaces.ts │ │ │ │ └── utils │ │ │ │ ├── attachProps.ts │ │ │ │ ├── case.ts │ │ │ │ ├── dev.ts │ │ │ │ └── index.tsx │ │ └── index.ts │ ├── package.json │ └── tsconfig.json ├── dough │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── example │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── res │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ └── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ └── settings.gradle │ │ ├── ios │ │ │ ├── .gitignore │ │ │ ├── Flutter │ │ │ │ ├── AppFrameworkInfo.plist │ │ │ │ ├── Debug.xcconfig │ │ │ │ └── Release.xcconfig │ │ │ ├── Podfile │ │ │ ├── Runner.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ ├── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── Runner.xcscheme │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── Runner │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ └── LaunchImage.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ └── README.md │ │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ │ ├── Info.plist │ │ │ │ └── Runner-Bridging-Header.h │ │ ├── lib │ │ │ ├── dough_widget_demos │ │ │ │ ├── custom_dough_demo.dart │ │ │ │ ├── dough_recipe_demo.dart │ │ │ │ ├── draggable_dough_demo.dart │ │ │ │ └── pressable_dough_demo.dart │ │ │ ├── main.dart │ │ │ └── routes.dart │ │ ├── pubspec.yaml │ │ └── web │ │ │ ├── favicon.png │ │ │ ├── icons │ │ │ ├── Icon-192.png │ │ │ └── Icon-512.png │ │ │ ├── index.html │ │ │ └── manifest.json │ ├── lib │ │ ├── dough.dart │ │ ├── src │ │ │ ├── dough │ │ │ │ ├── dough.dart │ │ │ │ ├── dough_controller.dart │ │ │ │ ├── dough_recipe.dart │ │ │ │ ├── dough_transformer.dart │ │ │ │ ├── draggable_dough.dart │ │ │ │ └── pressable_dough.dart │ │ │ └── utils │ │ │ │ ├── recipe.dart │ │ │ │ └── vector.dart │ │ └── utils.dart │ ├── pubspec.yaml │ └── test │ │ └── dough_test.dart └── dough_sensors │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── example │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ │ ├── .gitignore │ │ ├── app │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ └── values │ │ │ │ │ └── styles.xml │ │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ └── settings.gradle │ ├── ios │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ └── Release.xcconfig │ │ ├── Podfile │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ └── LaunchImage.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ └── README.md │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ └── Runner-Bridging-Header.h │ ├── lib │ │ ├── dough_widget_demos │ │ │ └── gyro_dough_demo.dart │ │ ├── main.dart │ │ └── routes.dart │ ├── pubspec.yaml │ └── web │ │ ├── favicon.png │ │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ │ ├── index.html │ │ └── manifest.json │ ├── lib │ ├── dough_sensors.dart │ └── src │ │ └── gyro_dough.dart │ ├── pubspec.yaml │ └── test │ └── dough_sensors_test.dart └── tsconfig.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | ## Status 10 | 11 | **READY/IN DEVELOPMENT/HOLD** 12 | 13 | ## Breaking Changes 14 | 15 | YES | NO 16 | 17 | ## Description 18 | 19 | 20 | 21 | ## Type of Change 22 | 23 | 24 | 25 | - [ ] ✨ New feature (non-breaking change which adds functionality) 26 | - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) 27 | - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) 28 | - [ ] 🧹 Code refactor 29 | - [ ] ✅ Build configuration change 30 | - [ ] 📝 Documentation 31 | - [ ] 🗑️ Chore 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .classpath 21 | .project 22 | .settings/ 23 | .vscode/ 24 | 25 | # Flutter repo-specific 26 | /bin/cache/ 27 | /bin/mingit/ 28 | /dev/benchmarks/mega_gallery/ 29 | /dev/bots/.recipe_deps 30 | /dev/bots/android_tools/ 31 | /dev/docs/doc/ 32 | /dev/docs/flutter.docs.zip 33 | /dev/docs/lib/ 34 | /dev/docs/pubspec.yaml 35 | /dev/integration_tests/**/xcuserdata 36 | /dev/integration_tests/**/Pods 37 | /packages/flutter/coverage/ 38 | version 39 | 40 | # packages file containing multi-root paths 41 | .packages.generated 42 | 43 | # Flutter/Dart/Pub related 44 | **/doc/api/ 45 | .dart_tool/ 46 | .flutter-plugins 47 | .flutter-plugins-dependencies 48 | .packages 49 | .pub-cache/ 50 | .pub/ 51 | build/ 52 | flutter_*.png 53 | linked_*.ds 54 | unlinked.ds 55 | unlinked_spec.ds 56 | 57 | # Android related 58 | **/android/**/gradle-wrapper.jar 59 | **/android/.gradle 60 | **/android/captures/ 61 | **/android/gradlew 62 | **/android/gradlew.bat 63 | **/android/local.properties 64 | **/android/**/GeneratedPluginRegistrant.java 65 | **/android/key.properties 66 | *.jks 67 | 68 | # iOS/XCode related 69 | **/ios/**/*.mode1v3 70 | **/ios/**/*.mode2v3 71 | **/ios/**/*.moved-aside 72 | **/ios/**/*.pbxuser 73 | **/ios/**/*.perspectivev3 74 | **/ios/**/*sync/ 75 | **/ios/**/.sconsign.dblite 76 | **/ios/**/.tags* 77 | **/ios/**/.vagrant/ 78 | **/ios/**/DerivedData/ 79 | **/ios/**/Icon? 80 | **/ios/**/Pods/ 81 | **/ios/**/.symlinks/ 82 | **/ios/**/profile 83 | **/ios/**/xcuserdata 84 | **/ios/.generated/ 85 | **/ios/Flutter/App.framework 86 | **/ios/Flutter/Flutter.framework 87 | **/ios/Flutter/Flutter.podspec 88 | **/ios/Flutter/Generated.xcconfig 89 | **/ios/Flutter/app.flx 90 | **/ios/Flutter/app.zip 91 | **/ios/Flutter/flutter_assets/ 92 | **/ios/Flutter/flutter_export_environment.sh 93 | **/ios/ServiceDefinitions.json 94 | **/ios/Runner/GeneratedPluginRegistrant.* 95 | 96 | # Coverage 97 | coverage/ 98 | coverage_badge.svg 99 | .test_coverage.dart 100 | *.lcov 101 | nohup.out 102 | 103 | # Exceptions to above rules. 104 | !**/ios/**/default.mode1v3 105 | !**/ios/**/default.mode2v3 106 | !**/ios/**/default.pbxuser 107 | !**/ios/**/default.perspectivev3 108 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 109 | !/dev/ci/**/Gemfile.lock 110 | 111 | # other stuff 112 | /node_modules/ -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at contact@josiahsaunders.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Dough 2 | 3 | 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 4 | 5 | The following is a set of guidelines for contributing to Dough and its packages. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. 6 | 7 | ## Proposing a change 8 | 9 | If you intend to change the public API, or make any non-trivial changes to the implementation, please file an issue first. This lets us reach an agreement on your proposal before you put significant effort into it. 10 | 11 | If you’re only fixing a bug, please file an issue detailing what you’re fixing (before creating a pull request). This is helpful in case we don’t accept that specific fix but want to keep track of the issue. 12 | 13 | ## Creating a pull request 14 | 15 | Before creating a pull request please: 16 | 17 | 1. Fork the repository and create your branch from `master`. 18 | 2. Install all dependencies (`flutter packages get` or `pub get`). 19 | 3. Squash your commits and ensure you have a meaningful commit message. 20 | 4. If you've changed the public API, make sure to update/add documentation. 21 | 5. Format your code (`dartfmt -w .`). 22 | 6. Analyze your code (`dartanalyzer --fatal-infos --fatal-warnings .`). 23 | 7. Create the Pull Request. 24 | 8. Verify that all status checks are passing. 25 | 26 | While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. 27 | 28 | ## License 29 | 30 | By contributing to Dough, you agree that your contributions will be licensed under its MIT license. 31 | 32 | ## Attribution 33 | 34 | This file was adapted from [Felix Angelov's Equatable package](https://github.com/felangel/equatable/blob/master/CONTRIBUTING.md). -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2021 Josiah Saunders 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Flutter Dough](./assets/images/dough-logo@repo.png) 2 | ![Flutter Dough Sensors](./assets/images/dough-sensors-logo@repo.png) 3 | ![Dough JS](./assets/images/dough-web-logo@repo.jpeg) 4 | ![Dough React](./assets/images/dough-react-logo@repo.png) 5 | 6 | # Dough Library 7 | 8 | Squishy widgets for Flutter and the web. 9 | 10 | ## Quick Links 11 | 12 | - [Flutter Dough](./packages/dough/README.md) 13 | - [Flutter Dough Sensors](./packages/dough_sensors/README.md) 14 | - [Dough JS](./packages/dough-js/readme.md) 15 | - [Dough React](./packages/dough-react/README.md) 16 | 17 | ## Demos 18 | 19 | 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](./packages/dough/README.md) project and the [Dough Sensors](./packages/dough_sensors/README.md) project. 20 | 21 | ### Pressable Dough 22 | 23 | ![PressableDough Demo](./assets/gifs/pressable-dough.gif) 24 | 25 | ### Draggable Dough 26 | 27 | ![DraggableDough Demo](./assets/gifs/draggable-dough.gif) 28 | 29 | ### Gyro Dough 30 | 31 | ![GyroDough Demo](./assets/gifs/gyro-dough.gif) 32 | 33 | ### Custom Dough 34 | 35 | ![CustomDough Demo](./assets/gifs/custom-dough.gif) 36 | 37 | -------------------------------------------------------------------------------- /assets/gifs/custom-dough.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/gifs/custom-dough.gif -------------------------------------------------------------------------------- /assets/gifs/dough-recipe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/gifs/dough-recipe.gif -------------------------------------------------------------------------------- /assets/gifs/draggable-dough.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/gifs/draggable-dough.gif -------------------------------------------------------------------------------- /assets/gifs/gyro-dough.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/gifs/gyro-dough.gif -------------------------------------------------------------------------------- /assets/gifs/pressable-dough.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/gifs/pressable-dough.gif -------------------------------------------------------------------------------- /assets/images/dough-logo@repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/images/dough-logo@repo.png -------------------------------------------------------------------------------- /assets/images/dough-react-logo@repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/images/dough-react-logo@repo.png -------------------------------------------------------------------------------- /assets/images/dough-sensors-logo@repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/images/dough-sensors-logo@repo.png -------------------------------------------------------------------------------- /assets/images/dough-web-logo@repo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/assets/images/dough-web-logo@repo.jpeg -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "version": "0.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": true, 4 | "workspaces": [ 5 | "packages/*" 6 | ], 7 | "devDependencies": { 8 | "@types/node": "^20.12.4", 9 | "lerna": "^8.1.2", 10 | "typescript": "^5.4.3" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/dough-js/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /packages/dough-js/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | www/ 3 | loader/ 4 | 5 | *~ 6 | *.sw[mnpcod] 7 | *.log 8 | *.lock 9 | *.tmp 10 | *.tmp.* 11 | log.txt 12 | *.sublime-project 13 | *.sublime-workspace 14 | 15 | .stencil/ 16 | .idea/ 17 | .vscode/ 18 | .sass-cache/ 19 | .versions/ 20 | node_modules/ 21 | $RECYCLE.BIN/ 22 | 23 | .DS_Store 24 | Thumbs.db 25 | UserInterfaceState.xcuserstate 26 | .env 27 | -------------------------------------------------------------------------------- /packages/dough-js/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "bracketSpacing": true, 4 | "jsxBracketSameLine": false, 5 | "jsxSingleQuote": false, 6 | "quoteProps": "consistent", 7 | "printWidth": 180, 8 | "semi": true, 9 | "singleQuote": true, 10 | "tabWidth": 2, 11 | "trailingComma": "all", 12 | "useTabs": false 13 | } 14 | -------------------------------------------------------------------------------- /packages/dough-js/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/dough-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dough-js", 3 | "version": "0.0.23", 4 | "description": "This library provides widgets that can be used to create a smooshy user interface.", 5 | "module": "dist/index.js", 6 | "types": "dist/types/index.d.ts", 7 | "collection": "dist/collection/collection-manifest.json", 8 | "collection:main": "dist/collection/index.js", 9 | "main": "dist/index.cjs.js", 10 | "unpkg": "dist/dough-js/dough-js.esm.js", 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/josiahsrc/dough" 14 | }, 15 | "files": [ 16 | "dist/", 17 | "loader/" 18 | ], 19 | "bugs": { 20 | "url": "https://github.com/josiahsrc/dough/issues" 21 | }, 22 | "scripts": { 23 | "build": "stencil build --docs", 24 | "start": "stencil build --dev --watch --serve --no-open", 25 | "test": "stencil test --spec --e2e", 26 | "test.watch": "stencil test --spec --e2e --watchAll", 27 | "generate": "stencil generate" 28 | }, 29 | "devDependencies": { 30 | "@stencil/core": "^4.7.0", 31 | "@stencil/react-output-target": "^0.5.3", 32 | "@stencil/sass": "^3.0.5", 33 | "@types/jest": "^29.5.6", 34 | "@types/node": "^16.18.11", 35 | "jest": "^29.7.0", 36 | "jest-cli": "^29.7.0", 37 | "puppeteer": "^21.9.0" 38 | }, 39 | "publishConfig": { 40 | "access": "public" 41 | }, 42 | "license": "MIT" 43 | } 44 | -------------------------------------------------------------------------------- /packages/dough-js/readme.md: -------------------------------------------------------------------------------- 1 | ![Dough JS](https://github.com/josiahsrc/dough/blob/master/assets/images/dough-web-logo@repo.jpeg?raw=true) 2 | 3 | This package provides some widgets you can use to create a smooshy UI. 4 | 5 | - [Source code](https://github.com/josiahsrc/dough) 6 | 7 | 8 | 9 | ![Alpha](https://img.shields.io/badge/alpha-yellow.svg) 10 | 11 | ## How to use 12 | 13 | This package provides squishy UI components that you can use right out of the box. Or, optionally, you can create your own. 14 | 15 | Add the following to your `index.html` file: 16 | 17 | ```html 18 | 19 | ``` 20 | 21 | ### Pressable Dough 22 | 23 | Wrap any component in `dough-pressable` to make it squish based on a user's input gestures. 24 | 25 | ```html 26 | 27 | 28 | 29 | ``` 30 | 31 | ![PressableDough Demo](./assets/gifs/pressable-dough.gif) 32 | 33 | ### Draggable Dough 34 | 35 | `dough-draggable` allows you to drag and drop components around... Only this time it's squishy! 36 | 37 | ```html 38 | 39 | 40 | 41 | ``` 42 | 43 | ![DraggableDough Demo](./assets/gifs/draggable-dough.gif) 44 | 45 | ### Make your own Dough 46 | 47 | If the above widgets aren't exactly what you're looking for, you can easily create your own squishy component using the provided `dough-all-purpose-flour` component! Check out the `dough-pressable` implementation for how to do that. 48 | 49 | ![CustomDough Demo](./assets/gifs/custom-dough.gif) 50 | 51 | --- 52 | 53 | ## Customize how the Dough feels 54 | 55 | If you don't like the default dough settings, you can easily change how the dough feels. Just update the provided `viscosity` and `adhesion` parameters. 56 | 57 | ```html 58 | 59 | 60 | 61 | ``` 62 | 63 | --- 64 | 65 | ## Contributing 66 | 67 | Contributions to this package are always welcome! Please read the [contributing guidlines](../../CONTRIBUTING.md). 68 | 69 | - If you have an idea/suggestion/bug-report, feel free to [create a ticket](https://github.com/josiahsrc/dough/issues). 70 | - If you created a custom `Dough` widget or some other awesome feature that you want to share with the community, you can fork the [repository](https://github.com/josiahsrc/dough) and submit a pull request! 71 | 72 | --- 73 | 74 | keywords: dough, rubber, elastic, rubber-band, rubberband, stretchy, squishy, smooshy, linear-algebra, matrix, transformation, flexible, draggable, drag, pressable, custom, ui, ux, interactive, animation, engage, stencil, react, angular, vue, flutter, web, mobile, responsive 75 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-all-purpose-flour/dough-all-purpose-flour.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 4 | } 5 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-all-purpose-flour/readme.md: -------------------------------------------------------------------------------- 1 | # dough-all-purpose-flour 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Properties 9 | 10 | | Property | Attribute | Description | Type | Default | 11 | | ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | 12 | | `active` | `active` | Set active to true when you want to manipulate the dough. Set to false when you want it to smooth back to its original position. | `boolean` | `false` | 13 | | `adhesion` | `adhesion` | The adhesion of the dough. The higher the number, the more the dough will stick to its original position. | `number` | `4` | 14 | | `originX` | `origin-x` | The origin X coordinate of the dough. This is the point that the dough will try to return to. | `number` | `0` | 15 | | `originY` | `origin-y` | The origin Y coordinate of the dough. This is the point that the dough will try to return to. | `number` | `0` | 16 | | `targetX` | `target-x` | The target X coordinate of the dough. This is the point that the dough will try to move to. | `number` | `0` | 17 | | `targetY` | `target-y` | The target Y coordinate of the dough. This is the point that the dough will try to move to. | `number` | `0` | 18 | | `viscosity` | `viscosity` | The viscosity of the dough. The higher the number, the more the dough will resist movement. | `number` | `4` | 19 | 20 | 21 | ## Dependencies 22 | 23 | ### Used by 24 | 25 | - [dough-draggable](../dough-draggable) 26 | - [dough-pressable](../dough-pressable) 27 | 28 | ### Graph 29 | ```mermaid 30 | graph TD; 31 | dough-draggable --> dough-all-purpose-flour 32 | dough-pressable --> dough-all-purpose-flour 33 | style dough-all-purpose-flour fill:#f9f,stroke:#333,stroke-width:4px 34 | ``` 35 | 36 | ---------------------------------------------- 37 | 38 | *Built with [StencilJS](https://stenciljs.com/)* 39 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-draggable/dough-draggable.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 4 | } 5 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-draggable/readme.md: -------------------------------------------------------------------------------- 1 | # dough-draggable 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Properties 9 | 10 | | Property | Attribute | Description | Type | Default | 11 | | ----------- | ----------- | --------------------------------------------------------------------------------------------------------- | -------- | ------- | 12 | | `adhesion` | `adhesion` | The adhesion of the dough. The higher the number, the more the dough will stick to its original position. | `number` | `4` | 13 | | `viscosity` | `viscosity` | The viscosity of the dough. The higher the number, the more the dough will resist movement. | `number` | `4` | 14 | 15 | 16 | ## Events 17 | 18 | | Event | Description | Type | 19 | | ---------------- | ----------- | ---------------------------------------- | 20 | | `doughDragEnd` | | `CustomEvent<{ x: number; y: number; }>` | 21 | | `doughDragMove` | | `CustomEvent<{ x: number; y: number; }>` | 22 | | `doughDragStart` | | `CustomEvent<{ x: number; y: number; }>` | 23 | 24 | 25 | ## Dependencies 26 | 27 | ### Depends on 28 | 29 | - [dough-all-purpose-flour](../dough-all-purpose-flour) 30 | 31 | ### Graph 32 | ```mermaid 33 | graph TD; 34 | dough-draggable --> dough-all-purpose-flour 35 | style dough-draggable fill:#f9f,stroke:#333,stroke-width:4px 36 | ``` 37 | 38 | ---------------------------------------------- 39 | 40 | *Built with [StencilJS](https://stenciljs.com/)* 41 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-pressable/dough-pressable.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-pressable/dough-pressable.tsx: -------------------------------------------------------------------------------- 1 | import { Component, Host, Prop, State, h } from '@stencil/core'; 2 | 3 | @Component({ 4 | tag: 'dough-pressable', 5 | styleUrl: 'dough-pressable.scss', 6 | shadow: true, 7 | }) 8 | export class DoughPressable { 9 | private startX: number = 0; 10 | private startY: number = 0; 11 | 12 | /** 13 | * The adhesion of the dough. The higher the number, the more the dough will stick to its original position. 14 | * @type {number} 15 | */ 16 | @Prop() adhesion: number = 8; 17 | /** 18 | * The viscosity of the dough. The higher the number, the more the dough will resist movement. 19 | * @type {number} 20 | */ 21 | @Prop() viscosity: number = 10; 22 | 23 | @State() active: boolean = false; 24 | @State() deltaX: number = 0; 25 | @State() deltaY: number = 0; 26 | 27 | onStart(e: MouseEvent | TouchEvent) { 28 | this.active = true; 29 | 30 | if (e instanceof MouseEvent) { 31 | this.startX = e.clientX; 32 | this.startY = e.clientY; 33 | } else { 34 | this.startX = e.touches[0].clientX; 35 | this.startY = e.touches[0].clientY; 36 | } 37 | 38 | // Add event listeners to the document 39 | document.addEventListener('mousemove', this.onMove.bind(this)); 40 | document.addEventListener('mouseup', this.onEnd.bind(this)); 41 | document.addEventListener('touchmove', this.onMove.bind(this)); 42 | document.addEventListener('touchend', this.onEnd.bind(this)); 43 | } 44 | 45 | onMove(e: MouseEvent | TouchEvent) { 46 | if (!this.active) return; 47 | 48 | let x = 0; 49 | let y = 0; 50 | if (e instanceof MouseEvent) { 51 | x = e.clientX; 52 | y = e.clientY; 53 | } else { 54 | x = e.touches[0].clientX; 55 | y = e.touches[0].clientY; 56 | } 57 | 58 | this.deltaX = x - this.startX; 59 | this.deltaY = y - this.startY; 60 | } 61 | 62 | onEnd(_: MouseEvent | TouchEvent) { 63 | this.active = false; 64 | this.deltaX = 0; 65 | this.deltaY = 0; 66 | this.startX = 0; 67 | this.startY = 0; 68 | 69 | // Remove event listeners from the document 70 | document.removeEventListener('mousemove', this.onMove.bind(this)); 71 | document.removeEventListener('mouseup', this.onEnd.bind(this)); 72 | document.removeEventListener('touchmove', this.onMove.bind(this)); 73 | document.removeEventListener('touchend', this.onEnd.bind(this)); 74 | } 75 | 76 | render() { 77 | return ( 78 | 79 | 80 | 81 | 82 | 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /packages/dough-js/src/components/dough-pressable/readme.md: -------------------------------------------------------------------------------- 1 | # dough-pressable 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Properties 9 | 10 | | Property | Attribute | Description | Type | Default | 11 | | ----------- | ----------- | --------------------------------------------------------------------------------------------------------- | -------- | ------- | 12 | | `adhesion` | `adhesion` | The adhesion of the dough. The higher the number, the more the dough will stick to its original position. | `number` | `8` | 13 | | `viscosity` | `viscosity` | The viscosity of the dough. The higher the number, the more the dough will resist movement. | `number` | `10` | 14 | 15 | 16 | ## Dependencies 17 | 18 | ### Depends on 19 | 20 | - [dough-all-purpose-flour](../dough-all-purpose-flour) 21 | 22 | ### Graph 23 | ```mermaid 24 | graph TD; 25 | dough-pressable --> dough-all-purpose-flour 26 | style dough-pressable fill:#f9f,stroke:#333,stroke-width:4px 27 | ``` 28 | 29 | ---------------------------------------------- 30 | 31 | *Built with [StencilJS](https://stenciljs.com/)* 32 | -------------------------------------------------------------------------------- /packages/dough-js/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stencil Component Starter 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/dough-js/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Components, JSX } from './components'; 2 | -------------------------------------------------------------------------------- /packages/dough-js/src/utils/math.spec.ts: -------------------------------------------------------------------------------- 1 | import { Vec2 } from './math'; 2 | 3 | describe('vec2dAngleToSigned', () => { 4 | it('returns the signed angle between two vectors', () => { 5 | expect(Vec2.signedAngle(new Vec2(1, 0), new Vec2(0, 1))).toBeCloseTo(Math.PI / 2); 6 | expect(Vec2.signedAngle(new Vec2(0, 1), new Vec2(1, 0))).toBeCloseTo(-Math.PI / 2); 7 | expect(Vec2.signedAngle(new Vec2(1, 0), new Vec2(-1, 0))).toBeCloseTo(Math.PI); 8 | expect(Vec2.signedAngle(new Vec2(1, 0), new Vec2(1, 0))).toBeCloseTo(0); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/dough-js/src/utils/math.ts: -------------------------------------------------------------------------------- 1 | export function deg2rad(deg: number): number { 2 | return deg * (Math.PI / 180); 3 | } 4 | 5 | export function rad2deg(rad: number): number { 6 | return rad * (180 / Math.PI); 7 | } 8 | 9 | export class Vec2 { 10 | private _x: number; 11 | private _y: number; 12 | 13 | constructor(x: number, y: number) { 14 | this._x = x; 15 | this._y = y; 16 | } 17 | 18 | get x(): number { 19 | return this._x; 20 | } 21 | 22 | get y(): number { 23 | return this._y; 24 | } 25 | 26 | static zero(): Vec2 { 27 | return new Vec2(0, 0); 28 | } 29 | 30 | get length(): number { 31 | return Math.sqrt(this.x ** 2 + this.y ** 2); 32 | } 33 | 34 | static signedAngle(a: Vec2, b: Vec2): number { 35 | return Math.atan2(b.y, b.x) - Math.atan2(a.y, a.x); 36 | } 37 | 38 | static fullCircleAngle(target: Vec2, source?: Vec2): number { 39 | const a = source ?? new Vec2(1, 0); 40 | const b = target; 41 | const rawAngle = Vec2.signedAngle(a, b); 42 | if (rawAngle < 0.0) { 43 | return 2 * Math.PI + rawAngle; 44 | } else { 45 | return rawAngle; 46 | } 47 | } 48 | } 49 | 50 | export class Matrix4 { 51 | private elements: number[]; 52 | 53 | constructor(values: number[][]) { 54 | this.elements = new Array(16); 55 | for (let row = 0; row < 4; ++row) { 56 | for (let col = 0; col < 4; ++col) { 57 | this.set(row, col, values[row][col]); 58 | } 59 | } 60 | } 61 | 62 | static zero(): Matrix4 { 63 | return new Matrix4([ 64 | [0, 0, 0, 0], 65 | [0, 0, 0, 0], 66 | [0, 0, 0, 0], 67 | [0, 0, 0, 0], 68 | ]); 69 | } 70 | 71 | static identity(): Matrix4 { 72 | return new Matrix4([ 73 | [1, 0, 0, 0], 74 | [0, 1, 0, 0], 75 | [0, 0, 1, 0], 76 | [0, 0, 0, 1], 77 | ]); 78 | } 79 | 80 | static skew(alphaRadians: number, betaRadians: number): Matrix4 { 81 | const a = Math.tan(alphaRadians); 82 | const b = Math.tan(betaRadians); 83 | return new Matrix4([ 84 | [1, a, 0, 0], 85 | [b, 1, 0, 0], 86 | [0, 0, 1, 0], 87 | [0, 0, 1, 1], 88 | ]); 89 | } 90 | 91 | static scale(x: number, y: number, z: number): Matrix4 { 92 | return new Matrix4([ 93 | [x, 0, 0, 0], 94 | [0, y, 0, 0], 95 | [0, 0, z, 0], 96 | [0, 0, 1, 1], 97 | ]); 98 | } 99 | 100 | static translate(x: number, y: number, z: number): Matrix4 { 101 | return new Matrix4([ 102 | [1, 0, 0, x], 103 | [0, 1, 0, y], 104 | [0, 0, 1, z], 105 | [0, 0, 1, 1], 106 | ]); 107 | } 108 | 109 | static translateVec2(vec: Vec2): Matrix4 { 110 | return Matrix4.translate(vec.x, vec.y, 0); 111 | } 112 | 113 | static rotateZ(radians: number): Matrix4 { 114 | const cos = Math.cos(radians); 115 | const sin = Math.sin(radians); 116 | return new Matrix4([ 117 | [cos, -sin, 0, 0], 118 | [sin, cos, 0, 0], 119 | [0, 0, 1, 0], 120 | [0, 0, 1, 1], 121 | ]); 122 | } 123 | 124 | get(row: number, col: number): number { 125 | if (row < 0 || row > 3 || col < 0 || col > 3) { 126 | throw new Error('Matrix4 indices are out of range'); 127 | } 128 | return this.elements[col * 4 + row]; 129 | } 130 | 131 | private set(row: number, col: number, value: number): void { 132 | if (row < 0 || row > 3 || col < 0 || col > 3) { 133 | throw new Error('Matrix4 indices are out of range'); 134 | } 135 | this.elements[col * 4 + row] = value; 136 | } 137 | 138 | multiply(other: Matrix4): Matrix4 { 139 | const result = Matrix4.zero(); 140 | 141 | for (let row = 0; row < 4; ++row) { 142 | for (let col = 0; col < 4; ++col) { 143 | let sum = 0; 144 | for (let k = 0; k < 4; ++k) { 145 | sum += this.get(row, k) * other.get(k, col); 146 | } 147 | result.set(row, col, sum); 148 | } 149 | } 150 | 151 | return result; 152 | } 153 | 154 | toCssMatrix(): string { 155 | return `matrix3d(${this.elements.join(',')})`; 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /packages/dough-js/stencil.config.ts: -------------------------------------------------------------------------------- 1 | import { Config } from '@stencil/core'; 2 | import { reactOutputTarget } from '@stencil/react-output-target'; 3 | 4 | export const config: Config = { 5 | namespace: 'dough-js', 6 | outputTargets: [ 7 | { 8 | type: 'dist', 9 | esmLoaderPath: '../loader', 10 | }, 11 | { 12 | type: 'docs-readme', 13 | }, 14 | { 15 | type: 'www', 16 | serviceWorker: false, 17 | }, 18 | reactOutputTarget({ 19 | componentCorePackage: 'dough-js', 20 | proxiesFile: '../dough-react/lib/components/stencil-generated/index.ts', 21 | }), 22 | ], 23 | }; 24 | -------------------------------------------------------------------------------- /packages/dough-js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "allowUnreachableCode": false, 5 | "declaration": false, 6 | "experimentalDecorators": true, 7 | "lib": ["dom", "es2017"], 8 | "moduleResolution": "node", 9 | "module": "esnext", 10 | "target": "es2017", 11 | "noUnusedLocals": true, 12 | "noUnusedParameters": true, 13 | "jsx": "react", 14 | "jsxFactory": "h" 15 | }, 16 | "include": ["src"], 17 | "exclude": ["node_modules"] 18 | } 19 | -------------------------------------------------------------------------------- /packages/dough-react/README.md: -------------------------------------------------------------------------------- 1 | ![Dough React](https://github.com/josiahsrc/dough/blob/master/assets/images/dough-react-logo@repo.png?raw=true) 2 | 3 | This package provides some widgets you can use to create a smooshy UI. 4 | 5 | - [Source code](https://github.com/josiahsrc/dough) 6 | 7 | 8 | 9 | ![Alpha](https://img.shields.io/badge/alpha-yellow.svg) 10 | 11 | ## How to use 12 | 13 | This package provides squishy UI components that you can use right out of the box. Or, optionally, you can create your own. 14 | 15 | To use This component you must call defineCustomElements() from `@dough-react` in your app's entry file. 16 | 17 | ```tsx 18 | import { defineCustomElements } from 'dough-react'; 19 | 20 | defineCustomElements(); 21 | ``` 22 | 23 | ### Pressable Dough 24 | 25 | Wrap any component in `DoughPressable` to make it squish based on a user's input gestures. 26 | 27 | ```tsx 28 | 29 | 30 | 31 | ``` 32 | 33 | ![DoughPressable Demo](./assets/gifs/pressable-dough.gif) 34 | 35 | ### Draggable Dough 36 | 37 | `DoughDraggable` allows you to drag and drop components around... Only this time it's squishy! 38 | 39 | ```tsx 40 | 41 | 42 | 43 | ``` 44 | 45 | ![DraggableDough Demo](./assets/gifs/draggable-dough.gif) 46 | 47 | ### Make your own Dough 48 | 49 | If the above widgets aren't exactly what you're looking for, you can easily create your own squishy component using the provided `DoughAllPurposeFlour` component! Check out the `DoughPressable` implementation for how to do that. 50 | 51 | ![DoughAllPurposeFlour Demo](./assets/gifs/custom-dough.gif) 52 | 53 | --- 54 | 55 | ## Customize how the Dough feels 56 | 57 | If you don't like the default dough settings, you can easily change how the dough feels. Just update the provided `viscosity` and `adhesion` parameters. 58 | 59 | ```tsx 60 | 61 | 62 | 63 | ``` 64 | 65 | --- 66 | 67 | ## Contributing 68 | 69 | Contributions to this package are always welcome! Please read the [contributing guidlines](../../CONTRIBUTING.md). 70 | 71 | - If you have an idea/suggestion/bug-report, feel free to [create a ticket](https://github.com/josiahsrc/dough/issues). 72 | - If you created a custom `Dough` widget or some other awesome feature that you want to share with the community, you can fork the [repository](https://github.com/josiahsrc/dough) and submit a pull request! 73 | 74 | --- 75 | 76 | keywords: dough, rubber, elastic, rubber-band, rubberband, stretchy, squishy, smooshy, linear-algebra, matrix, transformation, flexible, draggable, drag, pressable, custom, ui, ux, interactive, animation, engage, stencil, react, angular, vue, flutter, web, mobile, responsive 77 | -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/index.js: -------------------------------------------------------------------------------- 1 | import { createReactComponent } from './react-component-lib'; 2 | export const DoughAllPurposeFlour = createReactComponent('dough-all-purpose-flour'); 3 | export const DoughDraggable = createReactComponent('dough-draggable'); 4 | export const DoughPressable = createReactComponent('dough-pressable'); 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/components/stencil-generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,CAAC,MAAM,oBAAoB,GAAgB,oBAAoB,CAA4D,yBAAyB,CAAC,CAAC;AAC5J,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,iBAAiB,CAAC,CAAC;AAClI,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,iBAAiB,CAAC,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/createComponent.js: -------------------------------------------------------------------------------- 1 | var __rest = (this && this.__rest) || function (s, e) { 2 | var t = {}; 3 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 4 | t[p] = s[p]; 5 | if (s != null && typeof Object.getOwnPropertySymbols === "function") 6 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 7 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 8 | t[p[i]] = s[p[i]]; 9 | } 10 | return t; 11 | }; 12 | import React, { createElement } from 'react'; 13 | import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils'; 14 | export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => { 15 | if (defineCustomElement !== undefined) { 16 | defineCustomElement(); 17 | } 18 | const displayName = dashToPascalCase(tagName); 19 | const ReactComponent = class extends React.Component { 20 | constructor(props) { 21 | super(props); 22 | this.setComponentElRef = (element) => { 23 | this.componentEl = element; 24 | }; 25 | } 26 | componentDidMount() { 27 | this.componentDidUpdate(this.props); 28 | } 29 | componentDidUpdate(prevProps) { 30 | attachProps(this.componentEl, this.props, prevProps); 31 | } 32 | render() { 33 | const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]); 34 | let propsToPass = Object.keys(cProps).reduce((acc, name) => { 35 | const value = cProps[name]; 36 | if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) { 37 | const eventName = name.substring(2).toLowerCase(); 38 | if (typeof document !== 'undefined' && isCoveredByReact(eventName)) { 39 | acc[name] = value; 40 | } 41 | } 42 | else { 43 | const type = typeof value; 44 | if (type === 'string' || type === 'boolean' || type === 'number') { 45 | acc[camelToDashCase(name)] = value; 46 | } 47 | } 48 | return acc; 49 | }, {}); 50 | if (manipulatePropsFunction) { 51 | propsToPass = manipulatePropsFunction(this.props, propsToPass); 52 | } 53 | const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style }); 54 | return createElement(tagName, newProps, children); 55 | } 56 | static get displayName() { 57 | return displayName; 58 | } 59 | }; 60 | if (ReactComponentContext) { 61 | ReactComponent.contextType = ReactComponentContext; 62 | } 63 | return createForwardRef(ReactComponent, displayName); 64 | }; 65 | //# sourceMappingURL=createComponent.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/createComponent.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/createComponent.tsx"],"names":[],"mappings":"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"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/createOverlayComponent.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"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"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/index.js: -------------------------------------------------------------------------------- 1 | export { createReactComponent } from './createComponent'; 2 | export { createOverlayComponent } from './createOverlayComponent'; 3 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/interfaces.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/attachProps.js: -------------------------------------------------------------------------------- 1 | import { camelToDashCase } from './case'; 2 | export const attachProps = (node, newProps, oldProps = {}) => { 3 | if (node instanceof Element) { 4 | const className = getClassName(node.classList, newProps, oldProps); 5 | if (className !== '') { 6 | node.className = className; 7 | } 8 | Object.keys(newProps).forEach((name) => { 9 | if (name === 'children' || 10 | name === 'style' || 11 | name === 'ref' || 12 | name === 'class' || 13 | name === 'className' || 14 | name === 'forwardedRef') { 15 | return; 16 | } 17 | if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) { 18 | const eventName = name.substring(2); 19 | const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1); 20 | if (!isCoveredByReact(eventNameLc)) { 21 | syncEvent(node, eventNameLc, newProps[name]); 22 | } 23 | } 24 | else { 25 | node[name] = newProps[name]; 26 | const propType = typeof newProps[name]; 27 | if (propType === 'string') { 28 | node.setAttribute(camelToDashCase(name), newProps[name]); 29 | } 30 | } 31 | }); 32 | } 33 | }; 34 | export const getClassName = (classList, newProps, oldProps) => { 35 | const newClassProp = newProps.className || newProps.class; 36 | const oldClassProp = oldProps.className || oldProps.class; 37 | const currentClasses = arrayToMap(classList); 38 | const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []); 39 | const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []); 40 | const finalClassNames = []; 41 | currentClasses.forEach((currentClass) => { 42 | if (incomingPropClasses.has(currentClass)) { 43 | finalClassNames.push(currentClass); 44 | incomingPropClasses.delete(currentClass); 45 | } 46 | else if (!oldPropClasses.has(currentClass)) { 47 | finalClassNames.push(currentClass); 48 | } 49 | }); 50 | incomingPropClasses.forEach((s) => finalClassNames.push(s)); 51 | return finalClassNames.join(' '); 52 | }; 53 | export const transformReactEventName = (eventNameSuffix) => { 54 | switch (eventNameSuffix) { 55 | case 'doubleclick': 56 | return 'dblclick'; 57 | } 58 | return eventNameSuffix; 59 | }; 60 | export const isCoveredByReact = (eventNameSuffix) => { 61 | if (typeof document === 'undefined') { 62 | return true; 63 | } 64 | else { 65 | const eventName = 'on' + transformReactEventName(eventNameSuffix); 66 | let isSupported = eventName in document; 67 | if (!isSupported) { 68 | const element = document.createElement('div'); 69 | element.setAttribute(eventName, 'return;'); 70 | isSupported = typeof element[eventName] === 'function'; 71 | } 72 | return isSupported; 73 | } 74 | }; 75 | export const syncEvent = (node, eventName, newEventHandler) => { 76 | const eventStore = node.__events || (node.__events = {}); 77 | const oldEventHandler = eventStore[eventName]; 78 | if (oldEventHandler) { 79 | node.removeEventListener(eventName, oldEventHandler); 80 | } 81 | node.addEventListener(eventName, (eventStore[eventName] = function handler(e) { 82 | if (newEventHandler) { 83 | newEventHandler.call(this, e); 84 | } 85 | })); 86 | }; 87 | const arrayToMap = (arr) => { 88 | const map = new Map(); 89 | arr.forEach((s) => map.set(s, s)); 90 | return map; 91 | }; 92 | //# sourceMappingURL=attachProps.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/attachProps.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"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"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/case.js: -------------------------------------------------------------------------------- 1 | export const dashToPascalCase = (str) => str 2 | .toLowerCase() 3 | .split('-') 4 | .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)) 5 | .join(''); 6 | export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`); 7 | //# sourceMappingURL=case.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/case.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/dev.js: -------------------------------------------------------------------------------- 1 | export const isDevMode = () => { 2 | return process && process.env && process.env.NODE_ENV === 'development'; 3 | }; 4 | const warnings = {}; 5 | export const deprecationWarning = (key, message) => { 6 | if (isDevMode()) { 7 | if (!warnings[key]) { 8 | console.warn(message); 9 | warnings[key] = true; 10 | } 11 | } 12 | }; 13 | //# sourceMappingURL=dev.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/dev.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | export const setRef = (ref, value) => { 3 | if (typeof ref === 'function') { 4 | ref(value); 5 | } 6 | else if (ref != null) { 7 | ref.current = value; 8 | } 9 | }; 10 | export const mergeRefs = (...refs) => { 11 | return (value) => { 12 | refs.forEach((ref) => { 13 | setRef(ref, value); 14 | }); 15 | }; 16 | }; 17 | export const createForwardRef = (ReactComponent, displayName) => { 18 | const forwardRef = (props, ref) => { 19 | return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref })); 20 | }; 21 | forwardRef.displayName = displayName; 22 | return React.forwardRef(forwardRef); 23 | }; 24 | export const defineCustomElement = (tagName, customElement) => { 25 | if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) { 26 | customElements.define(tagName, customElement); 27 | } 28 | }; 29 | export * from './attachProps'; 30 | export * from './case'; 31 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/components/stencil-generated/react-component-lib/utils/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA+D,EAAE,KAAU,EAAE,EAAE;IACpG,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;IACb,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAEtB,GAAmC,CAAC,OAAO,GAAG,KAAK,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAAG,IAAoE,EAC/C,EAAE;IAC1B,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAwB,cAAmB,EAAE,WAAmB,EAAE,EAAE;IAClG,MAAM,UAAU,GAAG,CACjB,KAAuD,EACvD,GAA0C,EAC1C,EAAE;QACF,OAAO,oBAAC,cAAc,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC1D,CAAC,CAAC;IACF,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;IAErC,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,aAAkB,EAAE,EAAE;IACzE,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACzG,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/index.js: -------------------------------------------------------------------------------- 1 | export * from './components/stencil-generated'; 2 | export { defineCustomElements } from "dough-js/loader"; 3 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /packages/dough-react/dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"} -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import type { JSX } from 'dough-js'; 3 | export declare const DoughAllPurposeFlour: import("react").ForwardRefExoticComponent, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes>; 4 | export declare const DoughDraggable: import("react").ForwardRefExoticComponent, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes>; 5 | export declare const DoughPressable: import("react").ForwardRefExoticComponent, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes>; 6 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/createComponent.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | export interface HTMLStencilElement extends HTMLElement { 3 | componentOnReady(): Promise; 4 | } 5 | interface StencilReactInternalProps extends React.HTMLAttributes { 6 | forwardedRef: React.RefObject; 7 | ref?: React.Ref; 8 | } 9 | export declare const createReactComponent: (tagName: string, ReactComponentContext?: React.Context, manipulatePropsFunction?: (originalProps: StencilReactInternalProps, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent> & React.RefAttributes>; 10 | export {}; 11 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/createOverlayComponent.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { OverlayEventDetail } from './interfaces'; 3 | import { StencilReactForwardedRef } from './utils'; 4 | interface OverlayElement extends HTMLElement { 5 | present: () => Promise; 6 | dismiss: (data?: any, role?: string | undefined) => Promise; 7 | } 8 | export interface ReactOverlayProps { 9 | children?: React.ReactNode; 10 | isOpen: boolean; 11 | onDidDismiss?: (event: CustomEvent) => void; 12 | onDidPresent?: (event: CustomEvent) => void; 13 | onWillDismiss?: (event: CustomEvent) => void; 14 | onWillPresent?: (event: CustomEvent) => void; 15 | } 16 | export declare const createOverlayComponent: (tagName: string, controller: { 17 | create: (options: any) => Promise; 18 | }, customElement?: any) => React.ForwardRefExoticComponent; 20 | }> & React.RefAttributes>; 21 | export {}; 22 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/index.d.ts: -------------------------------------------------------------------------------- 1 | export { createReactComponent } from './createComponent'; 2 | export { createOverlayComponent } from './createOverlayComponent'; 3 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | export interface EventEmitter { 2 | emit: (data?: T) => CustomEvent; 3 | } 4 | export interface StyleReactProps { 5 | class?: string; 6 | className?: string; 7 | style?: { 8 | [key: string]: any; 9 | }; 10 | } 11 | export interface OverlayEventDetail { 12 | data?: T; 13 | role?: string; 14 | } 15 | export interface OverlayInterface { 16 | el: HTMLElement; 17 | animated: boolean; 18 | keyboardClose: boolean; 19 | overlayIndex: number; 20 | presented: boolean; 21 | enterAnimation?: any; 22 | leaveAnimation?: any; 23 | didPresent: EventEmitter; 24 | willPresent: EventEmitter; 25 | willDismiss: EventEmitter; 26 | didDismiss: EventEmitter; 27 | present(): Promise; 28 | dismiss(data?: any, role?: string): Promise; 29 | } 30 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/utils/attachProps.d.ts: -------------------------------------------------------------------------------- 1 | export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void; 2 | export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string; 3 | export declare const transformReactEventName: (eventNameSuffix: string) => string; 4 | export declare const isCoveredByReact: (eventNameSuffix: string) => boolean; 5 | export declare const syncEvent: (node: Element & { 6 | __events?: { 7 | [key: string]: (e: Event) => any; 8 | }; 9 | }, eventName: string, newEventHandler?: (e: Event) => any) => void; 10 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/utils/case.d.ts: -------------------------------------------------------------------------------- 1 | export declare const dashToPascalCase: (str: string) => string; 2 | export declare const camelToDashCase: (str: string) => string; 3 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/utils/dev.d.ts: -------------------------------------------------------------------------------- 1 | export declare const isDevMode: () => boolean; 2 | export declare const deprecationWarning: (key: string, message: string) => void; 3 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/components/stencil-generated/react-component-lib/utils/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import type { StyleReactProps } from '../interfaces'; 3 | export type StencilReactExternalProps = PropType & Omit, 'style'> & StyleReactProps; 4 | export type StencilReactForwardedRef = ((instance: T | null) => void) | React.MutableRefObject | null; 5 | export declare const setRef: (ref: StencilReactForwardedRef | React.Ref | undefined, value: any) => void; 6 | export declare const mergeRefs: (...refs: (StencilReactForwardedRef | React.Ref | undefined)[]) => React.RefCallback; 7 | export declare const createForwardRef: (ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent> & React.RefAttributes>; 8 | export declare const defineCustomElement: (tagName: string, customElement: any) => void; 9 | export * from './attachProps'; 10 | export * from './case'; 11 | -------------------------------------------------------------------------------- /packages/dough-react/dist/types/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './components/stencil-generated'; 2 | export { defineCustomElements } from "dough-js/loader"; 3 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | /* auto-generated react proxies */ 4 | import { createReactComponent } from './react-component-lib'; 5 | 6 | import type { JSX } from 'dough-js'; 7 | 8 | 9 | 10 | export const DoughAllPurposeFlour = /*@__PURE__*/createReactComponent('dough-all-purpose-flour'); 11 | export const DoughDraggable = /*@__PURE__*/createReactComponent('dough-draggable'); 12 | export const DoughPressable = /*@__PURE__*/createReactComponent('dough-pressable'); 13 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/createComponent.tsx: -------------------------------------------------------------------------------- 1 | import React, { createElement } from 'react'; 2 | 3 | import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils'; 4 | 5 | export interface HTMLStencilElement extends HTMLElement { 6 | componentOnReady(): Promise; 7 | } 8 | 9 | interface StencilReactInternalProps extends React.HTMLAttributes { 10 | forwardedRef: React.RefObject; 11 | ref?: React.Ref; 12 | } 13 | 14 | export const createReactComponent = < 15 | PropType, 16 | ElementType extends HTMLStencilElement, 17 | ContextStateType = {}, 18 | ExpandedPropsTypes = {} 19 | >( 20 | tagName: string, 21 | ReactComponentContext?: React.Context, 22 | manipulatePropsFunction?: ( 23 | originalProps: StencilReactInternalProps, 24 | propsToPass: any 25 | ) => ExpandedPropsTypes, 26 | defineCustomElement?: () => void 27 | ) => { 28 | if (defineCustomElement !== undefined) { 29 | defineCustomElement(); 30 | } 31 | 32 | const displayName = dashToPascalCase(tagName); 33 | const ReactComponent = class extends React.Component> { 34 | componentEl!: ElementType; 35 | 36 | setComponentElRef = (element: ElementType) => { 37 | this.componentEl = element; 38 | }; 39 | 40 | constructor(props: StencilReactInternalProps) { 41 | super(props); 42 | } 43 | 44 | componentDidMount() { 45 | this.componentDidUpdate(this.props); 46 | } 47 | 48 | componentDidUpdate(prevProps: StencilReactInternalProps) { 49 | attachProps(this.componentEl, this.props, prevProps); 50 | } 51 | 52 | render() { 53 | const { children, forwardedRef, style, className, ref, ...cProps } = this.props; 54 | 55 | let propsToPass = Object.keys(cProps).reduce((acc: any, name) => { 56 | const value = (cProps as any)[name]; 57 | 58 | if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) { 59 | const eventName = name.substring(2).toLowerCase(); 60 | if (typeof document !== 'undefined' && isCoveredByReact(eventName)) { 61 | acc[name] = value; 62 | } 63 | } else { 64 | // we should only render strings, booleans, and numbers as attrs in html. 65 | // objects, functions, arrays etc get synced via properties on mount. 66 | const type = typeof value; 67 | 68 | if (type === 'string' || type === 'boolean' || type === 'number') { 69 | acc[camelToDashCase(name)] = value; 70 | } 71 | } 72 | return acc; 73 | }, {} as ExpandedPropsTypes); 74 | 75 | if (manipulatePropsFunction) { 76 | propsToPass = manipulatePropsFunction(this.props, propsToPass); 77 | } 78 | 79 | const newProps: Omit, 'forwardedRef'> = { 80 | ...propsToPass, 81 | ref: mergeRefs(forwardedRef, this.setComponentElRef), 82 | style, 83 | }; 84 | 85 | /** 86 | * We use createElement here instead of 87 | * React.createElement to work around a 88 | * bug in Vite (https://github.com/vitejs/vite/issues/6104). 89 | * React.createElement causes all elements to be rendered 90 | * as instead of the actual Web Component. 91 | */ 92 | return createElement(tagName, newProps, children); 93 | } 94 | 95 | static get displayName() { 96 | return displayName; 97 | } 98 | }; 99 | 100 | // If context was passed to createReactComponent then conditionally add it to the Component Class 101 | if (ReactComponentContext) { 102 | ReactComponent.contextType = ReactComponentContext; 103 | } 104 | 105 | return createForwardRef(ReactComponent, displayName); 106 | }; 107 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/index.ts: -------------------------------------------------------------------------------- 1 | export { createReactComponent } from './createComponent'; 2 | export { createOverlayComponent } from './createOverlayComponent'; 3 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/interfaces.ts: -------------------------------------------------------------------------------- 1 | // General types important to applications using stencil built components 2 | export interface EventEmitter { 3 | emit: (data?: T) => CustomEvent; 4 | } 5 | 6 | export interface StyleReactProps { 7 | class?: string; 8 | className?: string; 9 | style?: { [key: string]: any }; 10 | } 11 | 12 | export interface OverlayEventDetail { 13 | data?: T; 14 | role?: string; 15 | } 16 | 17 | export interface OverlayInterface { 18 | el: HTMLElement; 19 | animated: boolean; 20 | keyboardClose: boolean; 21 | overlayIndex: number; 22 | presented: boolean; 23 | 24 | enterAnimation?: any; 25 | leaveAnimation?: any; 26 | 27 | didPresent: EventEmitter; 28 | willPresent: EventEmitter; 29 | willDismiss: EventEmitter; 30 | didDismiss: EventEmitter; 31 | 32 | present(): Promise; 33 | dismiss(data?: any, role?: string): Promise; 34 | } 35 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/utils/case.ts: -------------------------------------------------------------------------------- 1 | export const dashToPascalCase = (str: string) => 2 | str 3 | .toLowerCase() 4 | .split('-') 5 | .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)) 6 | .join(''); 7 | export const camelToDashCase = (str: string) => str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`); 8 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/utils/dev.ts: -------------------------------------------------------------------------------- 1 | export const isDevMode = () => { 2 | return process && process.env && process.env.NODE_ENV === 'development'; 3 | }; 4 | 5 | const warnings: { [key: string]: boolean } = {}; 6 | 7 | export const deprecationWarning = (key: string, message: string) => { 8 | if (isDevMode()) { 9 | if (!warnings[key]) { 10 | console.warn(message); 11 | warnings[key] = true; 12 | } 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/dough-react/lib/components/stencil-generated/react-component-lib/utils/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import type { StyleReactProps } from '../interfaces'; 4 | 5 | export type StencilReactExternalProps = PropType & 6 | Omit, 'style'> & 7 | StyleReactProps; 8 | 9 | // This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17 10 | export type StencilReactForwardedRef = ((instance: T | null) => void) | React.MutableRefObject | null; 11 | 12 | export const setRef = (ref: StencilReactForwardedRef | React.Ref | undefined, value: any) => { 13 | if (typeof ref === 'function') { 14 | ref(value); 15 | } else if (ref != null) { 16 | // Cast as a MutableRef so we can assign current 17 | (ref as React.MutableRefObject).current = value; 18 | } 19 | }; 20 | 21 | export const mergeRefs = ( 22 | ...refs: (StencilReactForwardedRef | React.Ref | undefined)[] 23 | ): React.RefCallback => { 24 | return (value: any) => { 25 | refs.forEach((ref) => { 26 | setRef(ref, value); 27 | }); 28 | }; 29 | }; 30 | 31 | export const createForwardRef = (ReactComponent: any, displayName: string) => { 32 | const forwardRef = ( 33 | props: StencilReactExternalProps, 34 | ref: StencilReactForwardedRef 35 | ) => { 36 | return ; 37 | }; 38 | forwardRef.displayName = displayName; 39 | 40 | return React.forwardRef(forwardRef); 41 | }; 42 | 43 | export const defineCustomElement = (tagName: string, customElement: any) => { 44 | if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) { 45 | customElements.define(tagName, customElement); 46 | } 47 | }; 48 | 49 | export * from './attachProps'; 50 | export * from './case'; 51 | -------------------------------------------------------------------------------- /packages/dough-react/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components/stencil-generated'; 2 | export { defineCustomElements } from "dough-js/loader"; -------------------------------------------------------------------------------- /packages/dough-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dough-react", 3 | "version": "0.0.14", 4 | "description": "This library provides widgets that can be used to create a smooshy user interface.", 5 | "homepage": "https://github.com/josiahsrc/dough#readme", 6 | "license": "MIT", 7 | "main": "dist/index.js", 8 | "module": "dist/index.js", 9 | "types": "dist/types/index.d.ts", 10 | "unpkg": "dist/index.js", 11 | "directories": { 12 | "lib": "lib", 13 | "test": "__tests__" 14 | }, 15 | "files": [ 16 | "dist" 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/josiahsrc/dough.git" 21 | }, 22 | "scripts": { 23 | "test": "node ./__tests__/react-library.test.js", 24 | "build": "npm run tsc", 25 | "tsc": "tsc -p . --outDir ./dist" 26 | }, 27 | "bugs": { 28 | "url": "https://github.com/josiahsrc/dough/issues" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "dependencies": { 34 | "dough-js": "*" 35 | }, 36 | "devDependencies": { 37 | "@types/react": "^18.2.74", 38 | "react": "^18.2.0", 39 | "react-dom": "^18.2.0", 40 | "typescript": "^5.4.3" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/dough-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "lib": ["dom", "es2015"], 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "target": "es2015", 9 | "skipLibCheck": true, 10 | "jsx": "react", 11 | "allowSyntheticDefaultImports": true, 12 | "declarationDir": "./dist/types" 13 | }, 14 | "include": ["lib"], 15 | "exclude": ["node_modules"] 16 | } -------------------------------------------------------------------------------- /packages/dough/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b9b543d9265484132c798adaab6caca52055b08 8 | channel: beta 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/dough/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [2.0.0] - Jan 27, 2024. 2 | 3 | - Updated flutter version 4 | - [BREAKING] Renamed `DoughDraggablePrefs` to `DraggableDoughRecipeData` 5 | - [BREAKING] Pulled `GyroDough` out into its own `dough_sensors` package 6 | - Added a `AbstractDoughRecipe` class to make it easier to create custom recipes 7 | - Added `recipeOf` and `maybeRecipeOf` utilities for accessing recipes from context 8 | - Removed platform dependency on the `sensors` package 9 | - Changed some documentation 10 | - Added a `DraggableDoughRecipe` that can be used to specifically override the `DraggableDough` widget's recipe 11 | 12 | ## [1.0.4] - Feb 7, 2023. 13 | 14 | - Updated to support Flutter `3.7`. 15 | 16 | ## [1.0.3] - May 16, 2022. 17 | 18 | - Updated to support Flutter `3.0.0`. 19 | 20 | ## [1.0.2] - March 24, 2021. 21 | 22 | - Removed deprecated dependencies. 23 | - Fixed some linting. 24 | - Updated dependencies. 25 | 26 | ## [1.0.1] - March 24, 2021. 27 | 28 | - Fixed some linting. 29 | 30 | ## [1.0.0] - March 24, 2021. 31 | 32 | - Migrated to null-safety. 33 | - Updated the `DoughTransformer` API to be more extendable and easier to work with. 34 | - Updated project structure to be consistent with common projects. 35 | 36 | ## [0.3.7] - January 29, 2021. 37 | 38 | - Added support for long-press `Draggable` behavior 39 | 40 | ## [0.3.6] - September 13, 2020. 41 | 42 | - Reverted to environment `sdk: ">=2.7.0 <3.0.0"` 43 | 44 | ## [0.3.5] - September 1, 2020. 45 | 46 | - Added `awesome_flutter` badge 47 | - Added `very_good_analysis` badge 48 | - Updated environment sdk to `>=2.8.0 <3.0.0` 49 | 50 | ## [0.3.4] - August 11, 2020. 51 | 52 | - Reordered `CHANGELOG.md` (thanks @agungnursatria) 53 | 54 | ## [0.3.3] - August 10, 2020. 55 | 56 | - Resolved `GyroDough` sample gif issue (was referencing `master` branch) 57 | 58 | ## [0.3.2] - August 10, 2020. 59 | 60 | - Resized `GyroDough` sample gif (499kb) 61 | 62 | ## [0.3.1] - August 10, 2020. 63 | 64 | - Resized `GyroDough` sample gif 65 | - Refactored util file structure 66 | 67 | ## [0.3.0] - August 10, 2020. 68 | 69 | - Introduced `equatable` package for easier equality checking 70 | - Introduced `provider` package for stronger contextual dependency control 71 | - Added `analysis_options.yaml` to enforce consistent practices in codebase 72 | - Added a new `GyroDough` widget 73 | 74 | ## [0.2.3] - July 30, 2020. 75 | 76 | - Fixed a doc typo and removed redundant line (thanks @kmdinake) 77 | - Refactored `lib` structure to use `src` directory standard 78 | 79 | ## [0.2.2] - July 15, 2020. 80 | 81 | - Added keywords to `README.md` 82 | 83 | ## [0.2.1] - July 11, 2020. 84 | 85 | - Added multi-drag support for the DraggableDough widget 86 | 87 | ## [0.2.0] - July 5, 2020. 88 | 89 | - Added in perspective warp feature (thanks @Schwusch) 90 | - Added dough recipe example which uses perspective warp 91 | - Refactored transformation code 92 | 93 | ## [0.1.2] - July 4, 2020. 94 | 95 | - Created logo and updated `README.md` 96 | 97 | ## [0.1.1] - July 4, 2020. 98 | 99 | - Improved README.md layout 100 | 101 | ## [0.1.0] - July 4, 2020. 102 | 103 | - Added support for `DraggableDough` 104 | - Added draggable dough preferences 105 | - Improved examples 106 | - Applied strategy pattern to dough transformations 107 | - Added some built-in `DoughTransformer` strategies 108 | - Improved documentation 109 | 110 | ## [0.0.5] - June 29, 2020. 111 | 112 | - Fixed dough vsync disposal ordering issue 113 | - Improved example project structure 114 | 115 | ## [0.0.4] - June 29, 2020. 116 | 117 | - Removed unreferenced utility functions 118 | 119 | ## [0.0.3] - June 29, 2020. 120 | 121 | - Fixed formatting using `dart format` 122 | 123 | ## [0.0.2] - June 28, 2020. 124 | 125 | - Fixed the description for a better point score 126 | 127 | ## [0.0.1] - June 28, 2020. 128 | 129 | - Added support for `Dough` 130 | - Added dough controller 131 | - Created recipe for all types of dough 132 | - Created a simple pressable dough widget 133 | - Added an example project 134 | -------------------------------------------------------------------------------- /packages/dough/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2021 Josiah Saunders 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /packages/dough/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | -------------------------------------------------------------------------------- /packages/dough/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /packages/dough/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b9b543d9265484132c798adaab6caca52055b08 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /packages/dough/example/README.md: -------------------------------------------------------------------------------- 1 | # Flutter Dough Example 2 | 3 | This app has different demos that show how to use dough widgets. 4 | 5 | - [Dough Recipe Demo](./lib/dough_widget_demos/dough_recipe_demo.dart) 6 | - Provides an example of how to use the DoughRecipe widget which 7 | provides the "squish theme" for all dough widgets. 8 | 9 | - [Pressable Dough Demo](./lib/dough_widget_demos/pressable_dough_demo.dart) 10 | - Provides an example of how to use the PressableDough widget which 11 | smooshes its child around based on how a user presses the widget. 12 | 13 | - [Draggable Dough Demo](./lib/dough_widget_demos/draggable_dough_demo.dart) 14 | - Provides an example of how to use the DraggableDough widget which 15 | wraps a Draggable widget and makes it squishy. 16 | 17 | - [Custom Dough Demo](./lib/dough_widget_demos/custom_dough_demo.dart) 18 | - Provides an example of how to create your own squishy widgets. -------------------------------------------------------------------------------- /packages/dough/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | linter: 3 | rules: 4 | -------------------------------------------------------------------------------- /packages/dough/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/dough/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/dough/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /packages/dough/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /packages/dough/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /packages/dough/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /packages/dough/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /packages/dough/example/lib/dough_widget_demos/custom_dough_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:dough/dough.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | /// This page demonstrates how to create a custom [Dough] widget. 5 | /// 6 | /// In this example, the widget tells the dough to stretched based on 7 | /// if a toggle is switched on or not. See [_CustomDoughDemoState] for 8 | /// how it does this. 9 | class CustomDoughDemo extends StatefulWidget { 10 | @override 11 | _CustomDoughDemoState createState() => _CustomDoughDemoState(); 12 | } 13 | 14 | /// The state of your custom dough widget. 15 | class _CustomDoughDemoState extends State { 16 | /// The controller that determines when the dough should stretch. 17 | final doughController = DoughController(); 18 | 19 | /// A flag to indicate whether the dough should stretch or not. 20 | bool isStretched = false; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | // Our widget that we're gonna squish. 25 | final myCustomDough = DoughRecipe( 26 | /// Make how long it takes to start stretching a bit longer. 27 | data: DoughRecipe.of(context).copyWith( 28 | entryDuration: Duration(milliseconds: 250), 29 | ), 30 | child: Dough( 31 | child: Container( 32 | height: 100, 33 | width: 100, 34 | // An image of a cookie. 35 | child: Image.network( 36 | 'https://i.pinimg.com/originals/21/51/b8/2151b8dbdd5aba485f09dd5b74d679c9.png', 37 | ), 38 | ), 39 | controller: doughController, 40 | // transformer: You can create your own transformer to change how the dough morphs, 41 | // but you'll have to read the source code to understand how to do this. This is a 42 | // bit more complicated and requires a general knowledge of linear algebra. 43 | ), 44 | ); 45 | 46 | // A toggle for our dough stretching. Realistically, you'll probably want 47 | // to use a GestureDetector or Listener to determine where to start and end presses 48 | // based on user input. But for the sake of the demo this will be used instead. 49 | final doughToggle = Switch( 50 | value: isStretched, 51 | onChanged: (value) { 52 | // Toggle our stretch variable. 53 | setState(() { 54 | isStretched = !isStretched; 55 | 56 | // Start or stop a stretch based on our isStretched value. 57 | if (isStretched) { 58 | doughController.start( 59 | origin: Offset(0, 0), 60 | target: Offset(500, 500), 61 | ); 62 | } else { 63 | doughController.stop(); 64 | } 65 | }); 66 | }, 67 | ); 68 | 69 | return Scaffold( 70 | appBar: AppBar( 71 | title: Text('Custom Dough'), 72 | ), 73 | body: SizedBox.expand( 74 | child: Column( 75 | crossAxisAlignment: CrossAxisAlignment.center, 76 | mainAxisAlignment: MainAxisAlignment.center, 77 | children: [ 78 | Text('Toggle this to manipulate the dough!'), 79 | doughToggle, 80 | myCustomDough, 81 | ], 82 | ), 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /packages/dough/example/lib/dough_widget_demos/dough_recipe_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:dough/dough.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class DoughRecipeDemo extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | final myDraggableChild = Container( 8 | decoration: BoxDecoration( 9 | shape: BoxShape.circle, 10 | color: Colors.blue, 11 | ), 12 | width: 100, 13 | height: 100, 14 | child: Center( 15 | child: Text( 16 | 'Draggable', 17 | textAlign: TextAlign.center, 18 | style: Theme.of(context).textTheme.bodyText2, 19 | ), 20 | ), 21 | ); 22 | 23 | // This is the widget that gets dragged around. 24 | final myFeedbackWidget = Container( 25 | decoration: BoxDecoration( 26 | shape: BoxShape.circle, 27 | color: Colors.green, 28 | ), 29 | width: 100, 30 | height: 100, 31 | child: Center( 32 | child: Text( 33 | 'Feedback', 34 | textAlign: TextAlign.center, 35 | style: Theme.of(context).textTheme.bodyText2, 36 | ), 37 | ), 38 | ); 39 | 40 | // The default draggable dough widget. 41 | final myDefaultDraggableDough = DraggableDough( 42 | data: 'My data!', 43 | child: myDraggableChild, 44 | feedback: myFeedbackWidget, 45 | childWhenDragging: Container(), 46 | ); 47 | 48 | // To override the default draggable dough feel, just wrap it in a 49 | // DoughRecipe widget and you're good to go! For this widget we're 50 | // enabling `usePerspectiveWarp` to create a sense of mass for the 51 | // dough and make it feel more jiggly. 52 | final myDraggableDoughWithNewSettings = DoughRecipe( 53 | data: DoughRecipeData( 54 | adhesion: 4, 55 | viscosity: 300, 56 | usePerspectiveWarp: true, 57 | perspectiveWarpDepth: 0.02, 58 | exitDuration: Duration(milliseconds: 600), 59 | draggableRecipe: DraggableDoughRecipeData( 60 | breakDistance: 100, 61 | useHapticsOnBreak: true, 62 | ), 63 | ), 64 | child: myDefaultDraggableDough, 65 | ); 66 | 67 | // Display the draggable in the center of the page. 68 | return Scaffold( 69 | appBar: AppBar( 70 | title: Text('Dough Recipe'), 71 | ), 72 | body: Center( 73 | child: myDraggableDoughWithNewSettings, 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /packages/dough/example/lib/dough_widget_demos/draggable_dough_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:dough/dough.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | /// This page demonstrates how to use the [DraggableDough] widget. 5 | class DraggableDoughDemo extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | // This is the widget that appears before being dragged around. 9 | final myDraggableChild = Container( 10 | color: Colors.blue, 11 | width: 100, 12 | height: 100, 13 | child: Center( 14 | child: Text( 15 | 'Draggable', 16 | textAlign: TextAlign.center, 17 | style: Theme.of(context).textTheme.bodyText2, 18 | ), 19 | ), 20 | ); 21 | 22 | // This is the widget that gets dragged around. 23 | final myFeedbackWidget = Container( 24 | color: Colors.green, 25 | width: 100, 26 | height: 100, 27 | child: Center( 28 | child: Text( 29 | 'Squishy feedback', 30 | textAlign: TextAlign.center, 31 | style: Theme.of(context).textTheme.bodyText2, 32 | ), 33 | ), 34 | ); 35 | 36 | // Create the draggable dough widget using our child and feedback widgets. 37 | // Also apply a custom dough recipe to make this widget feel awesome :) 38 | final myDraggableDough = DoughRecipe( 39 | data: DoughRecipeData( 40 | adhesion: 4, 41 | viscosity: 500, 42 | draggableRecipe: DraggableDoughRecipeData( 43 | breakDistance: 80, 44 | useHapticsOnBreak: true, 45 | ), 46 | ), 47 | child: DraggableDough( 48 | data: 'My data!', 49 | child: myDraggableChild, 50 | feedback: myFeedbackWidget, 51 | longPress: false, 52 | onDoughBreak: () { 53 | // This callback is raised when the dough snaps from its hold at its origin. 54 | print('Demo dough snapped and is freely being dragged!'); 55 | }, 56 | ), 57 | ); 58 | 59 | // DraggableDough works just like the Flutter Draggable widget, except 60 | // it's squishy! So you can just use the already built drag widgets that 61 | // Flutter provides, no problem. 62 | final myDragTarget = DragTarget( 63 | builder: (context, candidateData, rejectedData) { 64 | return Container( 65 | height: 100, 66 | width: 100, 67 | color: candidateData.length > 0 ? Colors.lightGreen : Colors.grey, 68 | child: Center( 69 | child: Text( 70 | 'Drag target', 71 | textAlign: TextAlign.center, 72 | style: Theme.of(context).textTheme.bodyText2, 73 | ), 74 | ), 75 | ); 76 | }, 77 | onWillAccept: (value) => value == 'My data!', 78 | onAccept: (value) { 79 | print('the value "$value" was accepted!'); 80 | }, 81 | ); 82 | 83 | // Now just use the DraggableDough widget however you'd normally use 84 | // Flutter's native Draggable widget. 85 | return Scaffold( 86 | appBar: AppBar( 87 | title: Text('Draggable Dough'), 88 | ), 89 | body: Stack( 90 | children: [ 91 | Positioned( 92 | left: 50, 93 | top: 50, 94 | child: myDraggableDough, 95 | ), 96 | Positioned( 97 | right: 50, 98 | bottom: 50, 99 | child: myDragTarget, 100 | ), 101 | ], 102 | ), 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /packages/dough/example/lib/dough_widget_demos/pressable_dough_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:dough/dough.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | /// This page demonstrates how to use the [PressableDough] widget. 5 | class PressableDoughDemo extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | // Just a regular old floating action button. 9 | final fab = FloatingActionButton( 10 | onPressed: () {}, 11 | child: Icon(Icons.fingerprint), 12 | ); 13 | 14 | // Now the floating action button is smooshy! 15 | final doughFab = PressableDough( 16 | child: fab, 17 | ); 18 | 19 | // Just a regular old container 20 | final centerContainer = Container( 21 | width: 100, 22 | height: 100, 23 | child: Center( 24 | child: Text( 25 | 'Drag me around!', 26 | textAlign: TextAlign.center, 27 | style: Theme.of(context).textTheme.bodyText1, 28 | ), 29 | ), 30 | decoration: BoxDecoration( 31 | color: Colors.blue, 32 | borderRadius: BorderRadius.circular(10), 33 | ), 34 | ); 35 | 36 | // Now let's say we want to make the center container 37 | // squishy, but we want a different kind of squish. To do 38 | // that we just wrap the dough widget in another recipe! 39 | // Easy peasy. 40 | final doughCenterContainer = DoughRecipe( 41 | data: DoughRecipeData( 42 | viscosity: 3000, 43 | expansion: 1.025, 44 | ), 45 | child: PressableDough( 46 | child: centerContainer, 47 | onReleased: (details) { 48 | // This callback is raised when the user release their 49 | // hold on the pressable dough. 50 | print('I was released with ${details.delta} delta!'); 51 | }, 52 | ), 53 | ); 54 | 55 | return Scaffold( 56 | appBar: AppBar( 57 | title: Text('Pressable Dough'), 58 | ), 59 | body: Center( 60 | child: doughCenterContainer, 61 | ), 62 | floatingActionButton: doughFab, 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /packages/dough/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:dough/dough.dart'; 3 | 4 | import 'routes.dart'; 5 | 6 | void main() { 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | final app = MaterialApp( 14 | title: 'Flutter Demo', 15 | theme: ThemeData( 16 | primarySwatch: Colors.blue, 17 | visualDensity: VisualDensity.adaptivePlatformDensity, 18 | ), 19 | routes: Routes.define(), 20 | initialRoute: Routes.kHome, 21 | ); 22 | 23 | // Optionally, apply your own default dough recipe to your 24 | // whole app if you don't like the built in recipe. All dough 25 | // widgets will then default to use these settings. 26 | return DoughRecipe( 27 | data: DoughRecipeData( 28 | viscosity: 5000, 29 | adhesion: 14, 30 | ), 31 | child: app, 32 | ); 33 | } 34 | } 35 | 36 | /// This page just provides links to the different dough widget examples. 37 | class HomePage extends StatelessWidget { 38 | @override 39 | Widget build(BuildContext context) { 40 | final nav = Navigator.of(context); 41 | 42 | final pageList = [ 43 | ListTile( 44 | title: Text('Dough Recipe'), 45 | onTap: () => nav.pushNamed(Routes.kDoughRecipeDemo), 46 | ), 47 | Divider(), 48 | ListTile( 49 | title: Text('Pressable Dough'), 50 | onTap: () => nav.pushNamed(Routes.kPressableDough), 51 | ), 52 | ListTile( 53 | title: Text('Draggable Dough'), 54 | onTap: () => nav.pushNamed(Routes.kDraggableDough), 55 | ), 56 | Divider(), 57 | ListTile( 58 | title: Text('Custom Dough'), 59 | onTap: () => nav.pushNamed(Routes.kCustomDough), 60 | ), 61 | ]; 62 | 63 | return Scaffold( 64 | appBar: AppBar( 65 | title: Text('Flutter Demo Home Page'), 66 | ), 67 | body: ListView(children: pageList), 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /packages/dough/example/lib/routes.dart: -------------------------------------------------------------------------------- 1 | import 'main.dart'; 2 | 3 | import 'dough_widget_demos/custom_dough_demo.dart'; 4 | import 'dough_widget_demos/pressable_dough_demo.dart'; 5 | import 'dough_widget_demos/draggable_dough_demo.dart'; 6 | import 'dough_widget_demos/dough_recipe_demo.dart'; 7 | 8 | class Routes { 9 | static final kHome = '/'; 10 | static final kCustomDough = '/custom-dough'; 11 | static final kPressableDough = '/pressable-dough'; 12 | static final kDraggableDough = '/draggable-dough'; 13 | static final kDoughRecipeDemo = '/dough-recipe'; 14 | 15 | static define() => { 16 | kHome: (context) => HomePage(), 17 | kCustomDough: (context) => CustomDoughDemo(), 18 | kPressableDough: (context) => PressableDoughDemo(), 19 | kDraggableDough: (context) => DraggableDoughDemo(), 20 | kDoughRecipeDemo: (context) => DoughRecipeDemo(), 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /packages/dough/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dough_tester 2 | description: A Flutter application showcasing how to use the dough package. 3 | publish_to: "none" 4 | 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: '>=2.12.0 <3.0.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | cupertino_icons: ^1.0.2 15 | dough: 16 | path: ../ 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | uses-material-design: true 24 | -------------------------------------------------------------------------------- /packages/dough/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/web/favicon.png -------------------------------------------------------------------------------- /packages/dough/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /packages/dough/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /packages/dough/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /packages/dough/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/dough/lib/dough.dart: -------------------------------------------------------------------------------- 1 | export 'src/dough/dough.dart'; 2 | export 'src/dough/dough_controller.dart'; 3 | export 'src/dough/dough_recipe.dart'; 4 | export 'src/dough/dough_transformer.dart'; 5 | export 'src/dough/pressable_dough.dart'; 6 | export 'src/dough/draggable_dough.dart'; 7 | -------------------------------------------------------------------------------- /packages/dough/lib/src/dough/pressable_dough.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'dough.dart'; 4 | import 'dough_controller.dart'; 5 | import 'dough_transformer.dart'; 6 | 7 | /// Details for a [PressableDoughReleaseCallback]. 8 | @immutable 9 | class PressableDoughReleaseDetails { 10 | /// Creates a [PressableDoughReleaseDetails]. 11 | const PressableDoughReleaseDetails({ 12 | required this.delta, 13 | required this.position, 14 | }); 15 | 16 | /// How far the dough was dragged before it was released. 17 | final Offset delta; 18 | 19 | /// The global position of where the user released their hold on dough. 20 | final Offset position; 21 | } 22 | 23 | /// Raised when a user releases their hold on a [PressableDough] widget. 24 | typedef PressableDoughReleaseCallback = void Function( 25 | PressableDoughReleaseDetails details, 26 | ); 27 | 28 | /// A smooshable dough widget that morphs into different shapes based 29 | /// on how the user presses on it. 30 | class PressableDough extends StatefulWidget { 31 | /// Creates a [PressableDough] widget. 32 | const PressableDough({ 33 | Key? key, 34 | required this.child, 35 | this.onStart, 36 | this.onReleased, 37 | }) : super(key: key); 38 | 39 | /// The child to smoosh. 40 | final Widget child; 41 | 42 | /// A callback raised when a user starts a hold on the widget and has 43 | /// begun to squish it around. 44 | final VoidCallback? onStart; 45 | 46 | /// A callback raised when the user releases their hold on the widget 47 | /// (e.g. the user stopped smooshing the widget). 48 | final PressableDoughReleaseCallback? onReleased; 49 | 50 | @override 51 | PressableDoughState createState() => PressableDoughState(); 52 | } 53 | 54 | /// The state of a [PressableDough] widget which updates a [Dough] widget 55 | /// based on user input. 56 | class PressableDoughState extends State { 57 | final _controller = DoughController(); 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | final pressableInterface = GestureDetector( 62 | onPanStart: (details) { 63 | _controller.start( 64 | origin: details.globalPosition, 65 | target: details.globalPosition, 66 | ); 67 | widget.onStart?.call(); 68 | }, 69 | onPanUpdate: (details) { 70 | _controller.update( 71 | target: details.globalPosition, 72 | ); 73 | }, 74 | onPanEnd: (details) { 75 | if (_controller.isActive) { 76 | _controller.stop(); 77 | } 78 | 79 | widget.onReleased?.call( 80 | PressableDoughReleaseDetails( 81 | delta: _controller.delta, 82 | position: _controller.target, 83 | ), 84 | ); 85 | }, 86 | onPanCancel: () { 87 | if (_controller.isActive) { 88 | _controller.stop(); 89 | } 90 | }, 91 | behavior: HitTestBehavior.translucent, 92 | child: widget.child, 93 | ); 94 | 95 | return Dough( 96 | controller: _controller, 97 | transformer: BasicDoughTransformer(), 98 | child: pressableInterface, 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /packages/dough/lib/src/utils/recipe.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | /// Returns the recipe of type [T] from the context, or [fallbackData] if no 6 | /// recipe was found. 7 | T recipeOf({ 8 | required BuildContext context, 9 | required T fallbackData, 10 | required bool listen, 11 | }) { 12 | try { 13 | return Provider.of(context, listen: listen); 14 | } on ProviderNotFoundException { 15 | return fallbackData; 16 | } 17 | } 18 | 19 | /// Returns the recipe of type [T] from the context, or null if no recipe 20 | /// was found. 21 | T? maybeRecipeOf({ 22 | required BuildContext context, 23 | required bool listen, 24 | }) { 25 | try { 26 | return Provider.of(context, listen: listen); 27 | } on ProviderNotFoundException { 28 | return null; 29 | } 30 | } 31 | 32 | /// Inherited settings for squishy widgets. Use this to override 33 | /// the default squishy settings. Callers may implement this interface 34 | /// to expose their own recipes through the context. 35 | abstract class AbstractRecipe extends StatelessWidget { 36 | /// Creates a [AbstractRecipe] widget. 37 | const AbstractRecipe({ 38 | super.key, 39 | this.data, 40 | required this.child, 41 | }); 42 | 43 | /// This widget's child. Any squishy widget below this widget will inherit 44 | /// the [data] provided in this recipe. 45 | final Widget child; 46 | 47 | /// The settings to be applied to all relevant squishy widgets below this 48 | /// widget. 49 | final T? data; 50 | 51 | /// The fallback recipe. 52 | T get fallback; 53 | 54 | @override 55 | Widget build(BuildContext context) { 56 | return Provider.value( 57 | value: data ?? fallback, 58 | child: child, 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /packages/dough/lib/src/utils/vector.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:flutter/gestures.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:vector_math/vector_math_64.dart' as vmath; 6 | 7 | /// A Vector utility class. 8 | class VectorUtils { 9 | const VectorUtils._(); 10 | 11 | /// Computes the angle between [toDirection] and [fromDirection], 12 | /// with the result ranging between 0 and 2π radians. 13 | static double computeFullCircleAngle({ 14 | required vmath.Vector2 toDirection, 15 | vmath.Vector2? fromDirection, 16 | }) { 17 | final a = fromDirection ?? vmath.Vector2(1, 0); 18 | final b = toDirection; 19 | 20 | final rawAngle = -a.angleToSigned(b); 21 | if (rawAngle < 0.0) { 22 | return 2 * math.pi + rawAngle; 23 | } else { 24 | return rawAngle; 25 | } 26 | } 27 | 28 | /// Converts an [Offset] to a [vmath.Vector2]. 29 | static vmath.Vector2 offsetToVector(Offset offset) { 30 | return vmath.Vector2(offset.dx, offset.dy); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/dough/lib/utils.dart: -------------------------------------------------------------------------------- 1 | export 'src/utils/vector.dart'; 2 | export 'src/utils/recipe.dart'; 3 | -------------------------------------------------------------------------------- /packages/dough/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dough 2 | description: This library provides widgets that can be used to create a smooshy user interface. 3 | version: 2.0.0 4 | repository: https://github.com/josiahsrc/dough/tree/master/packages/dough 5 | homepage: https://josiahsaunders.com/ 6 | 7 | environment: 8 | sdk: ">=3.2.4 <4.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.5 13 | flutter: 14 | sdk: flutter 15 | provider: ^6.1.1 16 | vector_math: ^2.1.4 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | flutter_lints: ^2.0.0 22 | -------------------------------------------------------------------------------- /packages/dough/test/dough_test.dart: -------------------------------------------------------------------------------- 1 | // TODO 2 | -------------------------------------------------------------------------------- /packages/dough_sensors/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | build/ 30 | -------------------------------------------------------------------------------- /packages/dough_sensors/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "ef1af02aead6fe2414f3aafa5a61087b610e1332" 8 | channel: "stable" 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/dough_sensors/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.3 2 | 3 | * Improved documentation 4 | 5 | ## 0.0.2 6 | 7 | * Removed unused dependencies 8 | 9 | ## 0.0.1 10 | 11 | * Extracted gyro dough from dough into its own package 12 | -------------------------------------------------------------------------------- /packages/dough_sensors/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2021 Josiah Saunders 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /packages/dough_sensors/README.md: -------------------------------------------------------------------------------- 1 | ![Flutter Dough](../../assets/images/dough-sensors-logo@repo.png) 2 | 3 | [![Awesome: Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter) 4 | 5 | Smooshy widgets that use sensors. Builds on top of the [Dough](https://pub.dev/packages/dough) library. 6 | - [Flutter package](https://pub.dev/packages/dough_sensors) 7 | - [Source code](https://github.com/josiahsrc/dough) 8 | 9 | ## How to use 10 | 11 | This package provides sensor-based squishy widgets you can use right out of the box. For a more complete overview on how to use the Dough Sensors library, check out the [example project](./example/README.md) provided on GitHub. 12 | 13 | ### Gyro Dough 14 | 15 | Wrap any widget in `GyroDough` to make it squish based on how a user moves their phone around in physical space. This widget only works on devices that have accelerometer/gyroscope features. 16 | 17 | ``` 18 | GyroDough( 19 | child: Container( ... ), 20 | ); 21 | ``` 22 | 23 | You can find a full example of how to use this widget [here](example/lib/dough_widget_demos/gyro_dough_demo.dart). 24 | 25 | ![GyroDough Demo](../../assets/gifs/gyro-dough.gif) 26 | 27 | --- 28 | 29 | ## Customize how the Dough feels 30 | 31 | If you don't like the default dough settings, you can easily change how the dough feels. Just wrap any widget that uses `GyroDough` in a `GyroDoughRecipe` and you're good to go. 32 | 33 | ```dart 34 | GyroDoughRecipe( 35 | data: GyroDoughRecipeData( 36 | gyroMultiplier: 110, // Control the squishiness of the widget 37 | ... 38 | ), 39 | child: GyroDough( ... ), 40 | ); 41 | ``` 42 | 43 | You can find a full example of how to use this widget [here](example/lib/dough_widget_demos/gyro_dough_demo.dart). 44 | 45 | --- 46 | 47 | ## Contributing 48 | 49 | Contributions to this package are always welcome! Please read the [contributing guidlines](../../CONTRIBUTING.md). 50 | - If you have an idea/suggestion/bug-report, feel free to [create a ticket](https://github.com/josiahsrc/dough/issues). 51 | - If you created a custom `Dough` widget or some other awesome feature that you want to share with the community, you can fork the [repository](https://github.com/josiahsrc/dough) and submit a pull request! 52 | 53 | --- 54 | 55 | keywords: dough, rubber, elastic, rubber-band, rubberband, stretchy, squishy, smooshy, linear-algebra, matrix, transformation, flexible, draggable, drag, pressable, custom, ui, ux, interactive, animation, engage, sensors -------------------------------------------------------------------------------- /packages/dough_sensors/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b9b543d9265484132c798adaab6caca52055b08 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/README.md: -------------------------------------------------------------------------------- 1 | # Flutter Dough Example 2 | 3 | This app has different demos that show how to use dough widgets. 4 | 5 | - [Gyro Dough Demo](./lib/dough_widget_demos/gyro_dough_demo.dart) 6 | - Provides an example of how to use the GyroDough widget which 7 | wraps a Gyroscope widget and makes it squishy. 8 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | linter: 3 | rules: 4 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/lib/dough_widget_demos/gyro_dough_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:dough/dough.dart'; 2 | import 'package:dough_sensors/dough_sensors.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | /// This page demonstrates how to use the [GyroDough] widget. 6 | class GyroDoughDemo extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | final myWidgetToSquish = Container( 10 | decoration: BoxDecoration( 11 | shape: BoxShape.circle, 12 | color: Colors.green, 13 | ), 14 | width: 100, 15 | height: 100, 16 | child: Center( 17 | child: Text( 18 | 'Shake the phone', 19 | textAlign: TextAlign.center, 20 | style: Theme.of(context).textTheme.bodyText2, 21 | ), 22 | ), 23 | ); 24 | 25 | // Create a squishy widget which reacts to physical 26 | // phone movement! 27 | final mySquishyGyroWidget = DoughRecipe( 28 | data: DoughRecipeData( 29 | adhesion: 21, 30 | ), 31 | child: GyroDoughRecipe( 32 | data: GyroDoughRecipeData( 33 | gyroMultiplier: 110, 34 | ), 35 | child: GyroDough( 36 | child: myWidgetToSquish, 37 | ), 38 | ), 39 | ); 40 | 41 | return Scaffold( 42 | appBar: AppBar( 43 | title: Text('Gyro Dough'), 44 | ), 45 | body: Padding( 46 | padding: const EdgeInsets.all(24.0), 47 | child: Column( 48 | crossAxisAlignment: CrossAxisAlignment.start, 49 | children: [ 50 | Text( 51 | 'NOTE', 52 | style: Theme.of(context).textTheme.headline6, 53 | textAlign: TextAlign.left, 54 | ), 55 | Text( 56 | 'This widget only works on devices that ' 57 | 'have accelerometer/gyroscope features...', 58 | textAlign: TextAlign.left, 59 | ), 60 | Spacer(), 61 | Center(child: mySquishyGyroWidget), 62 | Spacer(), 63 | ], 64 | ), 65 | ), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:dough/dough.dart'; 3 | 4 | import 'routes.dart'; 5 | 6 | void main() { 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | final app = MaterialApp( 14 | title: 'Flutter Demo', 15 | theme: ThemeData( 16 | primarySwatch: Colors.blue, 17 | visualDensity: VisualDensity.adaptivePlatformDensity, 18 | ), 19 | routes: Routes.define(), 20 | initialRoute: Routes.kHome, 21 | ); 22 | 23 | // Optionally, apply your own default dough recipe to your 24 | // whole app if you don't like the built in recipe. All dough 25 | // widgets will then default to use these settings. 26 | return DoughRecipe( 27 | data: DoughRecipeData( 28 | viscosity: 5000, 29 | adhesion: 14, 30 | ), 31 | child: app, 32 | ); 33 | } 34 | } 35 | 36 | /// This page just provides links to the different dough widget examples. 37 | class HomePage extends StatelessWidget { 38 | @override 39 | Widget build(BuildContext context) { 40 | final nav = Navigator.of(context); 41 | 42 | final pageList = [ 43 | ListTile( 44 | title: Text('Gyro Dough'), 45 | onTap: () => nav.pushNamed(Routes.kGyroDoughDemo), 46 | ), 47 | ]; 48 | 49 | return Scaffold( 50 | appBar: AppBar( 51 | title: Text('Flutter Demo Home Page'), 52 | ), 53 | body: ListView(children: pageList), 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/lib/routes.dart: -------------------------------------------------------------------------------- 1 | import 'main.dart'; 2 | 3 | import 'dough_widget_demos/gyro_dough_demo.dart'; 4 | 5 | class Routes { 6 | static final kHome = '/'; 7 | static final kGyroDoughDemo = '/gyro-dough'; 8 | 9 | static define() => { 10 | kHome: (context) => HomePage(), 11 | kGyroDoughDemo: (context) => GyroDoughDemo(), 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dough_tester 2 | description: A Flutter application showcasing how to use the dough package. 3 | publish_to: "none" 4 | 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: ">=2.12.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | cupertino_icons: ^1.0.2 15 | dough: 16 | path: ../../dough 17 | dough_sensors: 18 | path: ../ 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | 24 | flutter: 25 | uses-material-design: true 26 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/web/favicon.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josiahsrc/dough/4a24297e0db1fd52952a3ec7b346ee6dcd2f91ce/packages/dough_sensors/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /packages/dough_sensors/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /packages/dough_sensors/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/dough_sensors/lib/dough_sensors.dart: -------------------------------------------------------------------------------- 1 | export 'src/gyro_dough.dart'; 2 | -------------------------------------------------------------------------------- /packages/dough_sensors/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dough_sensors 2 | description: Smooshy widgets that use sensors. 3 | version: 0.0.2 4 | repository: https://github.com/josiahsrc/dough/tree/master/packages/dough_sensors 5 | homepage: https://josiahsaunders.com/ 6 | 7 | environment: 8 | sdk: ">=3.2.4 <4.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.5 13 | flutter: 14 | sdk: flutter 15 | sensors: ^2.0.3 16 | dough: ^2.0.0 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | flutter_lints: ^2.0.0 22 | -------------------------------------------------------------------------------- /packages/dough_sensors/test/dough_sensors_test.dart: -------------------------------------------------------------------------------- 1 | // TODO 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "noImplicitAny": false, 6 | "removeComments": true, 7 | "noLib": false, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es6", 11 | "sourceMap": true, 12 | "lib": ["es6"] 13 | }, 14 | "exclude": ["node_modules", "**/*.spec.ts", "**/__tests__/**"] 15 | } --------------------------------------------------------------------------------