-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MadBrains/initial_release
initial release
- Loading branch information
Showing
93 changed files
with
3,001 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
enable-beta-ecosystems: true | ||
updates: | ||
- package-ecosystem: "pub" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: pull_request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: 'Git Checkout' | ||
uses: actions/checkout@v3 | ||
- name: 'Install Flutter' | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
- name: 'Install Tools' | ||
run: flutter pub global activate fvm; make init; | ||
- name: 'Format Code' | ||
run: make fix | ||
- name: 'Validate Formatting' | ||
run: ./tool/validate-formatting.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: jacopocarlini/action-autotag@master | ||
with: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
package_root: "/" | ||
tag_prefix: "v" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
/pubspec.lock | ||
**/doc/api/ | ||
.dart_tool/ | ||
build/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
|
||
# FVM | ||
.fvm/ | ||
.fvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" | ||
channel: "stable" | ||
|
||
project_type: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 1.0.0 | ||
|
||
* Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.PHONY: version doctor | ||
|
||
PANA_SCRIPT = ./tool/verify_pub_score.sh 100 | ||
VALIDATE_SCRIPT = ./tool/validate-formatting.sh | ||
BUMPV_VERSION_SCRIPT = ./tool/bump-version.sh | ||
|
||
EXAMPLE_PATH = example | ||
|
||
FVM = fvm | ||
FVM_FLUTTER = $(FVM) flutter | ||
DART = dart | ||
FVM_DART = $(FVM) ${DART} | ||
|
||
|
||
init: | ||
make activate_fvm; $(FVM) use 3.24.3 --force; $(FVM_DART) pub global activate pana; | ||
|
||
activate_fvm: | ||
${DART} pub global activate ${FVM} | ||
|
||
version: | ||
$(FVM_FLUTTER) --version; $(FVM_DART) --version; | ||
|
||
doctor: | ||
$(FVM_FLUTTER) doctor; | ||
|
||
ifeq (bump, $(firstword $(MAKECMDGOALS))) | ||
runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) | ||
$(eval $(runargs):;@true) | ||
endif | ||
bump: | ||
./tool/bump-version.sh $(filter-out $@,$(MAKECMDGOALS)) | ||
|
||
pub_get: | ||
$(FVM_FLUTTER) packages get; | ||
|
||
clean: | ||
$(FVM_FLUTTER) clean; | ||
|
||
fix: | ||
$(FVM_DART) format .; | ||
|
||
analyze: | ||
$(FVM_FLUTTER) analyze . --fatal-infos; | ||
|
||
pana: | ||
$(PANA_SCRIPT); | ||
|
||
validate: | ||
$(VALIDATE_SCRIPT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# gravity_box | ||
|
||
A Flutter library that provides a GravityBox widget for simulating gravity inside of it. | ||
|
||
This widget uses the [GravitySensor](https://pub.dev/packages/gravity_sensor) package to get the device's gravity sensor data. | ||
|
||
## Features | ||
|
||
- **Gravity Simulation**: Simulate gravity for widgets using the `GravityBox` widget. | ||
- **Collision Detection**: Simple collision system between `GravityObject` and other children widgets. | ||
|
||
## Usage | ||
|
||
Import the package | ||
|
||
```dart | ||
import 'package:gravity_box/gravity_box.dart'; | ||
``` | ||
|
||
|
||
Use the widget. | ||
|
||
```dart | ||
GravityBox( | ||
gravityObjects: [ | ||
GravityObject( | ||
size: 100, | ||
widget: Container( | ||
width: 42, | ||
height: 42, | ||
color: Colors.purple, | ||
), | ||
), | ||
], | ||
); | ||
``` | ||
|
||
|
||
Provide a list of `GravityObject`s to the `gravityObjects` property. The `GravityBox` will automatically update the `GravityObject`s position and velocity based on the device's gravity sensor data.\ | ||
The `size` used to calculate bounding box of the object. Keep in mind that the size of the object is not the same as the size of the widget.\ | ||
The `position` is the top-left corner of the object in the `GravityBox` coordinate system (its layout contraints).\ | ||
If you want to add rolling ability (e.g. for circle-shaped widgets), set `canRoll: true` in the `GravityObject`.\ | ||
The `angle` is the current rotation degrees of the object.\ | ||
The `widget` is the widget that will be displayed as the object.\ | ||
|
||
```dart | ||
GravityBox( | ||
gravityObjects: [ | ||
GravityObject( | ||
size: 100, | ||
position: Vector2(50, 100), | ||
canRoll: true, | ||
angle: 90, | ||
widget: Container( | ||
width: 42, | ||
height: 42, | ||
color: Colors.purple, | ||
), | ||
), | ||
], | ||
); | ||
``` | ||
|
||
|
||
To display debug info for the `GravityObject`, such as its position and borders, set `debugShowObjectsPosition: true` in the `GravityBox`. | ||
|
||
```dart | ||
GravityBox( | ||
debugShowObjectsPosition: true, | ||
gravityObjects: [ | ||
GravityObject( | ||
child: Container( | ||
width: 42, | ||
height: 42, | ||
color: Colors.purple, | ||
), | ||
), | ||
], | ||
); | ||
``` | ||
|
||
|
||
To display additional widgets in `GravityBox`, provide them in the `children` property if you want them to collide with `GravityObject`s and in the `notCollidableChildren` property if you want them to not collide with `GravityObject`s. | ||
|
||
```dart | ||
const GravityBox( | ||
notCollidableChildren: [ | ||
Positioned.fill( | ||
child: ColoredBox(color: Color(0x80000000)), | ||
), | ||
], | ||
children: [FlutterLogo()], | ||
); | ||
``` | ||
|
||
## Example | ||
|
||
See full [Example][example] in the corresponding folder | ||
|
||
[example]: https://github.com/MadBrains/Gravity-Box-Flutter/tree/main/example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
/pubspec.lock | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio will place build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1" | ||
channel: "stable" | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: android | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: ios | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: linux | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: macos | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: web | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
- platform: windows | ||
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# example | ||
|
||
A new Flutter project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: package:flutter_lints/flutter.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
gradle-wrapper.jar | ||
/.gradle | ||
/captures/ | ||
/gradlew | ||
/gradlew.bat | ||
/local.properties | ||
GeneratedPluginRegistrant.java | ||
|
||
# Remember to never publicly share your keystore. | ||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app | ||
key.properties | ||
**/*.keystore | ||
**/*.jks |
Oops, something went wrong.